[issue23039] File name restriction on Windows
New submission from Philip Lee: when using open(filename, 'w') on Windows , File names are not allowed to contain any characters in \/:*?| , however open(filename, 'w') doesn't throw any exceptions when the file name contains these characters . I think some warning should be written in the documentation or exceptions thrown should happen when the file name contains these characters . -- components: IO messages: 232555 nosy: iMath priority: normal severity: normal status: open title: File name restriction on Windows type: enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23039 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23039] File name restriction on Windows
R. David Murray added the comment: The argument to open is a path. Some of those characters have a meaning in a path. I ran a couple of quick experiments: ab*c.txt fails with an exception. :16.txt created a file, which I can do an 'ls' and cat (but not rm) on in git-bash, but I'm not sure where it actually is in the file system. Open is just calling the OS to do the open, so if no error is raised, the *OS* (Windows) is not raising the error. I don't think there is a bug here, unless it is in Windows itself. -- components: +Windows nosy: +r.david.murray, steve.dower, tim.golden, zach.ware ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23039 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23039] File name restriction on Windows
Tim Golden added the comment: Agree with RDM: we're just passing the path through to the Windows API (on Windows). We don't generally carry out this kind of pre-emptive check. -- resolution: - not a bug stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23039 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com