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

> My VHDX mounted in a directory is affected by this

I created a VHDX and mounted it in a directory. It's just a regular volume 
mount point with a junction (IO_REPARSE_TAG_MOUNT_POINT). That won't cause any 
problems, so I guess your setup must be different in some way.

> I suspect (but haven't tested) that some file sharing handlers or 
> attached devices could also hit it - thinking here of IoT devices
> that provide a filesystem-like interface.

My takeaway is that because filesystem filter drivers on some systems may 
arbitrarily redirect some paths in some cases, and redirect differently or not 
at all in some other context, then we need to always log a warning showing the 
real path and always embed the real path in pip.exe. The only clear example we 
have is bpo-45337, but we're erring on the side of caution instead of targeting 
the warning at the one known case. The generic approach happens to also include 
any common use of directory symbolic links or junctions, but it's not practical 
to handle them differently. You're open to special casing short DOS names, 
however, e.g. by comparing the real path to the long path name from 
GetLongPathNameW().

Note that if the user continues to use the path with a reparse point or 
redirection to access the virtual environment (if possible; it's not for 
bpo-45337), then running `python -m pip` will install scripts or executable 
script wrappers that refer to the accessed path, not the real path. pip uses 
distlib for entrypoint scripts. Apparently distlib doesn't resolve the real 
path of sys.executable when creating the script shebang.

For POSIX, including macOS, I don't know the range of possibilities for 
dependent filesystem redirection. Bind mounts (i.e. mounting an arbitrary path 
on a directory) can be an issue since they're temporary unless configured in 
/etc/fstab. However, we can't do anything to warn about them because POSIX 
realpath() doesn't resolve them.

> warning that can be explained in exactly the same way on every platform

I guess you mean every edition of Windows.

----------

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

Reply via email to