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 steve.dower
Recipients Christian Åkerström, eric.smith, eryksun, ethan smith, ishimoto, jaraco, living180, ncdave4life, paul.moore, pitrou, steve.dower, stutzbach, takluyver, tim.golden, vstinner, zach.ware, Étienne Dupuis
Date 2019-08-14.22:31:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
FYI, there's been some discussion of this on issue37834, as the issues quickly became conflated.

There's also issue14094 which is a dup of this one, but with a different patch.


To move the relevant discussion here, my current PR is basically the tests from the last attached patch here plus a simpler implementation for non-strict resolution.

Right now the big open question is how to deal with the \\?\ prefix. My last two commits will leave it alone if it was in the initial path, and otherwise strip it if the non-prefixed path resolves to the same path as the prefixed path (the _getfinalpathname always returns a prefixed path).

The downside of this is that any unresolvable symlinks (dangling links, cycles, etc.) will now be returned with the prefix, whereas previously they were being returned without any attempt to resolve them being made (not because they are invalid, but because the old code wasn't attempting to resolve anything at all).

I kinda feel like this is okay, but would appreciate any other opinions on the matter. The alternative is to always strip the prefix, which could make some valid paths become invalid (for example, the one in the new test_realpath_symlink_prefix).
Date User Action Args
2019-08-14 22:31:07steve.dowersetrecipients: + steve.dower, paul.moore, ishimoto, jaraco, pitrou, vstinner, eric.smith, tim.golden, stutzbach, living180, takluyver, zach.ware, ncdave4life, eryksun, Christian Åkerström, ethan smith, Étienne Dupuis
2019-08-14 22:31:07steve.dowersetmessageid: <>
2019-08-14 22:31:07steve.dowerlinkissue9949 messages
2019-08-14 22:31:06steve.dowercreate