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 ronaldoussoren
Recipients ned.deily, ronaldoussoren
Date 2022-03-01.17:21:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1646155308.19.0.236069996557.issue46890@roundup.psfhosted.org>
In-reply-to
Content
This is be related to how the virtual environment is populated. In 3.10 the "python3.10" name in the environment is a symlink to sys.executable. In 3.10 "Python" (not the capital) is a symlink to the binary in Python.app and "python3.11" is a symlink to "Python".  Given that the filesystem is case preserving there is no "python" name.

The behaviour in 3.11 is clearly a bug: the virtual environment is no longer using the launcher binary in "{sys.prefix]/bin" but directly uses the "real" binary (in a framework build), and because of that scripts cannot use system APIs that expect to run in an application bundle. 

Listing "env/bin" in Python 3.10:
-rw-rw-r--  1 ronald  staff  9033 Mar  1 18:11 Activate.ps1
-rw-rw-r--  1 ronald  staff  2018 Mar  1 18:11 activate
-rw-rw-r--  1 ronald  staff   944 Mar  1 18:11 activate.csh
-rw-rw-r--  1 ronald  staff  2086 Mar  1 18:11 activate.fish
-rwxr-xr-x  1 ronald  staff   269 Mar  1 18:11 pip
-rwxr-xr-x  1 ronald  staff   269 Mar  1 18:11 pip3
-rwxr-xr-x  1 ronald  staff   269 Mar  1 18:11 pip3.10
lrwxr-xr-x  1 ronald  staff    10 Mar  1 18:11 python -> python3.10
lrwxr-xr-x  1 ronald  staff    10 Mar  1 18:11 python3 -> python3.10
lrwxr-xr-x  1 ronald  staff    65 Mar  1 18:11 python3.10 -> /Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10

In python3.11:
total 72
-rw-rw-r--  1 ronald  staff  9033 Mar  1 17:23 Activate.ps1
lrwxr-xr-x  1 ronald  staff    93 Mar  1 17:23 Python -> /Library/Frameworks/Python.framework/Versions/3.11/Resources/Python.app/Contents/MacOS/Python
-rw-rw-r--  1 ronald  staff  2018 Mar  1 17:23 activate
-rw-rw-r--  1 ronald  staff   944 Mar  1 17:23 activate.csh
-rw-rw-r--  1 ronald  staff  2086 Mar  1 17:23 activate.fish
-rwxr-xr-x  1 ronald  staff   265 Mar  1 17:23 pip
-rwxr-xr-x  1 ronald  staff   265 Mar  1 17:23 pip3
-rwxr-xr-x  1 ronald  staff   265 Mar  1 17:23 pip3.11
lrwxr-xr-x  1 ronald  staff     6 Mar  1 17:23 python3 -> Python
lrwxr-xr-x  1 ronald  staff     6 Mar  1 17:23 python3.11 -> Python
History
Date User Action Args
2022-03-01 17:21:48ronaldoussorensetrecipients: + ronaldoussoren, ned.deily
2022-03-01 17:21:48ronaldoussorensetmessageid: <1646155308.19.0.236069996557.issue46890@roundup.psfhosted.org>
2022-03-01 17:21:48ronaldoussorenlinkissue46890 messages
2022-03-01 17:21:48ronaldoussorencreate