Steve Dower <steve.do...@python.org> added the comment:

> I've pasted the diff below because I'm not yet convinced that it is correct 
> (in particular the value for "argv0".)
argv0 is literally what C sees in argv[0], which in the framework case I 
believe is calculated by a launcher?

The getpath.py change is probably adding an OS check for this line: 
https://github.com/python/cpython/blob/main/Modules/getpath.py#L304

if ENV_PYTHONEXECUTABLE or ENV___PYVENV_LAUNCHER__:
     # If set, these variables imply that we should be using them as
     # sys.executable and when searching for venvs. However, we should
     # use the argv0 path for prefix calculation
     if os_name != 'darwin':
         base_executable = executable
     if not real_executable:
         real_executable = executable
     executable = ENV_PYTHONEXECUTABLE or ENV___PYVENV_LAUNCHER__
     executable_dir = dirname(executable)

I think the comment "we should use the argv0 path for prefix 
calculation" isn't correct (anymore?) either, since updating 
executable_dir is going to do the opposite of that. But I guess there 
were tests proving otherwise. It won't affect this case, since both 
argv0 and ENV___PYVENV_LAUNCHER__ appear to be under the same prefix (at 
least in Ronald's example).

----------

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

Reply via email to