Eryk Sun <eryk...@gmail.com> added the comment:

> 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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43968>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to