Package: libpython3.11
Version: 3.11.1-1
Severity: normal
Tags: patch

Dear Maintainer,

If the python3.11-venv package is not installed, the following *incorrect*
error message is printed when creating a virtual environment:

  $ python3.11 -m venv my-venv
  Error: name 'cmd' is not defined

But I expected the following, correct, error message:

  The virtual environment was not created successfully because ensurepip is not
  available. On Debian/Ubuntu systems, you need to install the python3-venv
  package using the following command.

  apt install python3.11-venv

  You may need to use sudo with that command. After installing the python3-venv
  package, recreate your virtual environment.

  Failing command: ['/home/penlect/my-venv/bin/python3.11', '-m', 'ensurepip', 
'--upgrade', '--default-pip']

This error happens because of a typo in which 'cmd' is used as a local
variable instead of the attribute of the CalledProcessError exception in
`/usr/lib/python3.11/venv/__init__.py`.

Please see reference here:
https://docs.python.org/3/library/subprocess.html#subprocess.CalledProcessError.cmd

I created a merge request with a fix in the salsa-repo here:
https://salsa.debian.org/cpython-team/python3/-/merge_requests/26

-- System Information:
Debian Release: bookworm/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 6.0.0-6-amd64 (SMP w/16 CPU threads; PREEMPT)
Kernel taint flags: TAINT_USER
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages libpython3.11 depends on:
ii  libc6                 2.36-6
ii  libexpat1             2.5.0-1
ii  libpython3.11-stdlib  3.11.1-1
ii  zlib1g                1:1.2.13.dfsg-1

libpython3.11 recommends no packages.

libpython3.11 suggests no packages.

-- no debconf information

Reply via email to