[issue37834] readlink on Windows cannot read app exec links

Steve Dower report at bugs.python.org
Wed Aug 14 18:23:41 EDT 2019


Steve Dower <steve.dower at python.org> added the comment:

> Perhaps the best we can do is an additional test where we GetFinalPathName, strip the prefix, reopen the file, GetFinalPathName again and if they match then return it without the prefix. That should handle the both long path settings as transparently as we can.

I tried this and the downside (other than hitting the filesystem a few more times) is that any unresolvable path is going to come back with the prefix - e.g. symlink cycles and dangling links.

Maybe that's okay? The paths are going to be as valid as they can get (that is, unusable :) ) and it at least means that long paths and deliberately unnormalized paths.

Posted an update to PR 15287 with that change.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37834>
_______________________________________


More information about the Python-bugs-list mailing list