This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients eryksun, paul.moore, steve.dower, tim.golden, zach.ware
Date 2021-03-09.23:05:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1615331156.25.0.626111621937.issue43455@roundup.psfhosted.org>
In-reply-to
Content
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).
History
Date User Action Args
2021-03-09 23:05:56eryksunsetrecipients: + eryksun, paul.moore, tim.golden, zach.ware, steve.dower
2021-03-09 23:05:56eryksunsetmessageid: <1615331156.25.0.626111621937.issue43455@roundup.psfhosted.org>
2021-03-09 23:05:56eryksunlinkissue43455 messages
2021-03-09 23:05:56eryksuncreate