Message366123
Hi Eryk, thanks for your time and for the explanation.
> The Windows file API normalizes paths to replace forward slashes with backslashes; resolve relative paths and "." and ".." components; strip trailing spaces and dots from the final component; and map reserved DOS device names in the final component of non-UNC paths to device paths (e.g. "C:/Temp/con " -> r"\\.\con").
OK, I understand. I know that Win32 documentation suggests to avoid using paths with trailing spaces and that the paths are subject to normalization. Then I'd say os.path.normpath() should perform the same (GetFullPathNameW?) normalization as os.stat() and friends do.
Currently:
>>> import os
>>> path = r"c:\Program Files "
>>> os.path.normpath(path)
'c:\\Program Files '
>>> os.path.realpath(path)
'C:\\Program Files' |
|
Date |
User |
Action |
Args |
2020-04-10 13:18:28 | laloch | set | recipients:
+ laloch, paul.moore, tim.golden, zach.ware, eryksun, steve.dower, gaborjbernat |
2020-04-10 13:18:28 | laloch | set | messageid: <1586524708.7.0.997628891426.issue40238@roundup.psfhosted.org> |
2020-04-10 13:18:28 | laloch | link | issue40238 messages |
2020-04-10 13:18:28 | laloch | create | |
|