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, sfmc, steve.dower, tim.golden, zach.ware
Date 2021-04-30.18:00:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> E.g. if you specify env. var. PYTHON_NTREALPATH_OLD_BEHAVIOR=1, 
> it doesn't resolve symlinks and junctions.

I assumed you wanted to resolve symlinks but hadn't considered that substitute drives are implemented as object symlinks that target arbitrary paths, which can include other substitute/mapped drives and filesystem symlinks. They aren't handled as mount points, at least not during system path parsing.

If you don't need to resolve symlinks, just use os.path.abspath() in Windows and os.path.realpath() in POSIX. Don't worry about symlinks in the opened path in Windows. Unlike POSIX, the Windows API resolves a path like r"C:\example\symlink\..\dir" simply as r"C:\example\dir", before the kernel and filesystem ever see the path. There are reasons to need a real path in Windows, but this isn't one of them.
Date User Action Args
2021-04-30 18:00:21eryksunsetrecipients: + eryksun, paul.moore, tim.golden, zach.ware, steve.dower, sfmc
2021-04-30 18:00:21eryksunsetmessageid: <>
2021-04-30 18:00:21eryksunlinkissue43968 messages
2021-04-30 18:00:21eryksuncreate