PY-31961 Canonicalize both paths when checking that a module is not under site-packages
We started to resolve symlinks for resolved Python modules to combat the cases when there is an additional lib64/ entry in prefix pointing to lib/ directory. Unfortunately, it now breaks detection of stdlib modules when the whole SDK directory is symlinked somewhere else. It becomes especially noticeable for interpreters created with pyenv installed via brew on Mac OS, since there PYENV_ROOT directory is linked and actually reside under /usr/local/Cellar/. As a net result, something like /usr/local/Cellar/pyenv/1.2.7/versions/3.6.4/lib/python3.6/re.py (canonicalized) is not found under /usr/local/opt/pyenv/versions/3.6.4/lib/python3.6/.
Showing
+10 -4
Please register or sign in to comment