New submission from Christian Heimes: While I was testing #16499 I found a small bug in the venv code of the site module. The code in site.venv() doesn't use abspath() to sanitize the path to executable_dir. This leads to wrong behavior when a venv is created in the root of a hg checkout and the non-venv interpreter is called with a relative path:
(venv) heimes@hamiller:~/dev/python/cpython/venv$ ../python -c "import sys; print(sys.path)" ['', '/usr/local/lib/python34.zip', '/home/heimes/dev/python/cpython/Lib', '/home/heimes/dev/python/cpython/Lib/plat-linux', '/home/heimes/dev/python/cpython/build/lib.linux-x86_64-3.4-pydebug', '/home/heimes/dev/python/cpython/venv/lib/python3.4/site-packages'] The fix is simple, straight forward and totally harmless: --- a/Lib/site.py +++ b/Lib/site.py @@ -484,7 +484,7 @@ executable = os.environ['__PYVENV_LAUNCHER__'] else: executable = sys.executable - executable_dir, executable_name = os.path.split(executable) + executable_dir, executable_name = os.path.split(os.path.abspath(executable)) site_prefix = os.path.dirname(executable_dir) sys._home = None if sys.platform == 'win32': ---------- components: Interpreter Core messages: 176043 nosy: christian.heimes priority: normal severity: normal status: open title: site.venv() should use abspath(executable) type: behavior versions: Python 3.3, Python 3.4 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue16519> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com