[issue22744] os.mkdir on Windows silently strips trailing blanks from directory names

2017-03-24 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Pytho

[issue22744] os.mkdir on Windows silently strips trailing blanks from directory names

2014-10-27 Thread R. David Murray
R. David Murray added the comment: Yeah, to os.path, paths are just strings, and there's no reference made to the actual file system. The blanks are valid on unix, for example (unless you pass them to the shell without escaping them). As Steve indicated, parts of Pathlib might make a differe

[issue22744] os.mkdir on Windows silently strips trailing blanks from directory names

2014-10-27 Thread Steve Dower
Steve Dower added the comment: Paths are processed by the Windows API. This processing includes (at least): * resolve to current directory * convert forward slashes to backslashes * remove adjacent backslashes * trim trailing dots and spaces from names * resolve short path names This processing

[issue22744] os.mkdir on Windows silently strips trailing blanks from directory names

2014-10-27 Thread tegavu
tegavu added the comment: Well then the bug is also for example in the open() to create a file, beause it will also remove tailing spaces (files can have spaces in the front, while folders cannot have spces on either side). Although I still think an API to create a path should warn if this pat

[issue22744] os.mkdir on Windows silently strips trailing blanks from directory names

2014-10-27 Thread R. David Murray
R. David Murray added the comment: I would classify that as a bug in mkdir (it should raise an error). The blank-elimination is almost certainly being done at the OS layer (windows) rather than the Python layer, though, and I doubt it is something we can fix at the Python layer for backward c