Message388393
pathlib._WindowsFlavour.resolve() mistakenly assume that os.getcwd() returns a resolved path in Windows:
s = str(path)
if not s:
return os.getcwd()
I don't think this is a practical problem since `str(path)` should never be an empty string. But if there is a concern that the result is an empty string, the code should use `s = str(path) or '.'`, and resolve "." like any other relative path.
In POSIX the result of getcwd() "shall contain no components that are dot or dot-dot, or are symbolic links". In Windows, os.getcwd() calls WinAPI GetCurrentDirectoryW(), which returns a fully-qualified path that may contain symbolic components that would be resolved in a final path. This includes filesystem symlinks and bind mounts (junctions), as well as mapped and substitute drives (i.e. drives that resolve to a filesystem directory instead of a volume device). |
|
Date |
User |
Action |
Args |
2021-03-09 23:05:56 | eryksun | set | recipients:
+ eryksun, paul.moore, tim.golden, zach.ware, steve.dower |
2021-03-09 23:05:56 | eryksun | set | messageid: <1615331156.25.0.626111621937.issue43455@roundup.psfhosted.org> |
2021-03-09 23:05:56 | eryksun | link | issue43455 messages |
2021-03-09 23:05:56 | eryksun | create | |
|