[issue23463] Incorrect behaviour when opening files containing colons on Windows

Tom Edwards report at bugs.python.org
Sat Feb 14 13:48:56 CET 2015


Tom Edwards added the comment:

Ha! What a feature. Thanks for the link.

Maybe I'm rehashing old arguments, but I still think that Python's behaviour in this case is wrong. This is very surprising behaviour to anyone who isn't intimately familiar with NTFS and should not be something that in invoked silently.

Currently *everyone* who wants to open a file is expected to perform their own test for colons in the path, particularly those who are generating filenames from user data. (Unless they actually want to write to an alternate stream of course, but how often does that happen?)

This is behaviour also introduces a cross-platform inconsistency, as a filename on NTFS means something slightly different from a filename on any other file system.

Would it be wise for open() to only accept NTFS alternate stream path syntax if a special character is present in the 'mode' argument?

----------
components:  -Windows
resolution: not a bug -> 
status: closed -> open

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23463>
_______________________________________


More information about the Python-bugs-list mailing list