Eryk Sun <eryk...@gmail.com> added the comment:

> The pathlib module has _WindowsFlavour.reserved_names list of 
> Windows reserved names:

pathlib._WindowsFlavour.reserved_names is missing "CONIN$" and "CONOUT$". Prior 
to Windows 8 these two are reserved as relative names. In Windows 8+, they're 
also reserved in directories, just like the other reserved device names.

pathlib._WindowsFlavour.is_reserved() fails to reserve names containing ASCII 
control characters [0-31], vertical bar [|], the file-stream delimiter [:] 
(i.e. "filename:streamname:streamtype"), and the five wildcard characters 
[*?"<>]. (Maybe it should allow the file-stream delimiter, but that requires 
validating that a file stream is proper.) It fails to reserve names that end 
with a dot or space, which includes UNC and device paths except for \\?\ 
verbatim paths. It fails to match all reserved base names, which begin with a 
reserved device name, followed by zero or more spaces, a dot or colon, and zero 
or more characters. If names that contain colon are already reserved, then this 
check only has to be modified to strip trailing spaces before comparing against 
the list of reserved device names.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36534>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to