tags -1 + patch
thanks
On Sun, Dec 18, 2022 at 01:17:45AM +0900, Yu Sugawara wrote:
> Package: python3.10
> Version: 3.10.9-1
> Severity: normal
> X-Debbugs-Cc: [email protected]
>
> Dear Maintainer,
>
> When I tried to create a python3 venv environment, I got an error message
> "Error: name 'cmd' is not defined" and got partially-created venv environment
> [...]
> I found the following code snippet in /usr/lib/python3.10/venv/__init__.py
> is suspicious. It uses a variable 'cmd' without defining it.
>
> > def _setup_pip(self, context):
> > [...]
> > Failing command: {}
> > """.format(sysconfig.get_python_version(), cmd))
> > sys.exit(1)
I just hit the same bug, and I think others will if they try to set up
a Python 3.10 venv on bookworm (assuming that Python 3.10 still ships
with bookworm), as there are still many Python packages on PyPI that
do not yet support 3.11.
Simply change the last lines in this quoted section of _setup_pip
to read:
Failing command: {} -m ensurepip --upgrade --default-pip
""".format(sysconfig.get_python_version(), context.env_exec_cmd))
sys.exit(1)
Best wishes,
Julian