Antony Lee added the comment:
There is a list of always forbidden characters
(http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#naming_conventions),
and then a couple of obscure fs-dependent cases
(http://en.wikipedia.org/wiki/Comparison_of_file_systems) but I believe
excluding the main list should be enough for most purposes.
Note that PosixPath is not immune to this either, as there is one forbidden
character: the null byte.
I would prefer if path.open() can only raise one of the OSError subclasses that
correspond to errnos mentioned in "man 2 open". Currently, on Windows,
"Path('*').open()" raises an OSError ("invalid argument"); on Linux,
"Path('\0').open()" raises a TypeError(!).
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue21969>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com