This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author steve.dower
Recipients eric.snow, ned.deily, pablogsal, ronaldoussoren, steve.dower, vinay.sajip
Date 2022-03-02.16:28:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <c25aa1a9-1c63-4e51-68dd-c3bf92a536fe@python.org>
In-reply-to <1646229810.25.0.200283550108.issue46890@roundup.psfhosted.org>
Content
> 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).
History
Date User Action Args
2022-03-02 16:28:49steve.dowersetrecipients: + steve.dower, vinay.sajip, ronaldoussoren, ned.deily, eric.snow, pablogsal
2022-03-02 16:28:49steve.dowerlinkissue46890 messages
2022-03-02 16:28:49steve.dowercreate