New submission from Matthew Woodcraft <matt...@woodcraft.me.uk>:

PEP 405 says that the pyvenv.cfg file is found as follows:

« a pyvenv.cfg file is found either adjacent to the Python executable or one 
directory above it (if the executable is a symlink, it is not dereferenced), »

But in cpython if the executable is a symlink, it _is_ dereferenced before 
searching for pyvenv.cfg .

I've checked this behaviour with Python 3.5, 3.6, and today's 3.7 tip.

Looking in 3.7's getpath.c, calculate_path_impl() calls, in order:

   calculate_program_full_path()
   calculate_argv0_path()
   calculate_read_pyenv()

It looks like the symlink resolution happens near the end of 
calculate_argv0_path().


I think this means that the 'home=' line in pyvenv.cfg files generated by the 
'venv' module is irrelevant (and seems likely to confuse anyone who might try 
to construct a Python environment by imitating a built venv).

----------
components: Interpreter Core
messages: 315424
nosy: mattheww
priority: normal
severity: normal
status: open
title: The search for pyvenv.cfg doesn't match PEP 405
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7

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

Reply via email to