Your message dated Sun, 05 Mar 2023 08:49:37 +0000
with message-id <[email protected]>
and subject line Bug#1026268: fixed in python3.11 3.11.2-5
has caused the Debian Bug report #1026268,
regarding python3.10: `$ python3 -m venv dir` outputs "Error: name 'cmd' is not 
defined" if python3-venv is not installed.
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
1026268: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1026268
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
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.

Steps I did:
- Ran ` $ python3 -m venv venv ` to create a venv directory under the
  current directory, without installing python3-venv.

Expected:
- Have an error message "The virtual environment was not created successfully
  because ensurepip is not available."

Actual:
- Got an error message "Error: name 'cmd' is not defined" instead.

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):
>         """Installs or upgrades pip in a virtual environment"""
>         try:
>             self._call_new_python(context, '-m', 'ensurepip', '--upgrade',
>                                   '--default-pip', stderr=subprocess.STDOUT)
>         except subprocess.CalledProcessError:
>             stdlib = sysconfig.get_path('stdlib')
>             if not os.path.exists(f'{stdlib}/ensurepip/__main__.py'):
>                 print("""\
> 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 python{}-venv
> 
> You may need to use sudo with that command.  After installing the python3-venv
> package, recreate your virtual environment.
> 
> Failing command: {}
> """.format(sysconfig.get_python_version(), cmd))
>                 sys.exit(1)

I installed python3-venv and now venv works for me.
But I'd be glad if I could get the correct error message.

Thanks,

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

Kernel: Linux 6.0.0-5-amd64 (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
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 python3.10 depends on:
ii  libpython3.10-stdlib  3.10.9-1
ii  media-types           8.0.0
ii  mime-support          3.66
ii  python3.10-minimal    3.10.9-1

python3.10 recommends no packages.

Versions of packages python3.10 suggests:
ii  binutils         2.39.50.20221208-5
pn  python3.10-doc   <none>
ii  python3.10-venv  3.10.9-1

-- no debconf information

--- End Message ---
--- Begin Message ---
Source: python3.11
Source-Version: 3.11.2-5
Done: Matthias Klose <[email protected]>

We believe that the bug you reported is fixed in the latest version of
python3.11, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Matthias Klose <[email protected]> (supplier of updated python3.11 package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Sun, 05 Mar 2023 09:28:49 +0100
Source: python3.11
Architecture: source
Version: 3.11.2-5
Distribution: unstable
Urgency: medium
Maintainer: Matthias Klose <[email protected]>
Changed-By: Matthias Klose <[email protected]>
Closes: 1026268 1032019
Changes:
 python3.11 (3.11.2-5) unstable; urgency=medium
 .
   [ Matthias Klose ]
   * Update VCS attributes.
   * Fix error message for 'python3 -m venv dir`, when python3-venv
     is not installed. Closes: #1026268.
 .
   [ Stefano Rivera ]
   * Mention that deleting EXTERNALLY-MANAGED is an option, in README.venv.
   * Patch: fix deadlock at shutdown when clearing thread states.
     Closes: #1032019.
   * Override expat embedded-library lintian false-positives. (See: #1031859)
Checksums-Sha1:
 606ac40972e1d384782f3abaca7fabdcab0514d1 3636 python3.11_3.11.2-5.dsc
 1e8b0daf47f8d406d1a341b36a886510db4049b5 213432 
python3.11_3.11.2-5.debian.tar.xz
 6a8b439e5d90473422af50e8cf8781916d2647cf 10060 
python3.11_3.11.2-5_source.buildinfo
Checksums-Sha256:
 c4d050b13874c246e197c7bcb0f8c1dd665a9d41711f727dab7d54790a0e127e 3636 
python3.11_3.11.2-5.dsc
 c1181b1e7676e9b4b33c74f4d956ca16d54483c564a16ac08e6474c572c19e7a 213432 
python3.11_3.11.2-5.debian.tar.xz
 1ffbc52fead5728abbd5a36a3a9bc3bddf35b5aa79f54c13121867ce148356dc 10060 
python3.11_3.11.2-5_source.buildinfo
Files:
 7f869f88646689fc649fc18033f21a51 3636 python optional python3.11_3.11.2-5.dsc
 ed81da9de879d017b12e17a41ab79288 213432 python optional 
python3.11_3.11.2-5.debian.tar.xz
 6d95453a4f8b08fbc70db4b30688220b 10060 python optional 
python3.11_3.11.2-5_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQJEBAEBCgAuFiEE1WVxuIqLuvFAv2PWvX6qYHePpvUFAmQEUvkQHGRva29AZGVi
aWFuLm9yZwAKCRC9fqpgd4+m9UjJEACs4DxV/cpXeRcsnJxaLu6FUIM3z13wRidH
7YL1XwMIMvXIN9xEHn6NB6oLnI542UFtIQPJTxoBqavnELDi0hz8NnRgLF1BJ3RN
7cYgFw6zFlYdCsjd14BK6UepcOyEjV+/7NdiDClvrzu9Jw28KSmna7axn/x2dKqC
Jb0q1xKWa2FGYYllSA6Wc3+reu5xcAlTEtC8z6McIAgG4y1Z+BPpGwAlq7hdJeu5
kNvyM5pXpRfHpzdn+BW8t1FxaoIGYHts3i2ysKOujDLE08WGTD1m9zmS+1RDyXDz
1AQ53cBK/0bmZSrfXGRkm3a6Ij6zYJBNkPivckizlOHsgRQ+8d6Fp3nq2WGNDtb3
xSH+CnukuEEajsoWgu2bqa/SphZjP2aza/BqPn0XjX91xmezoMmUy1scqW/Ac+A7
jQhv5rDXnknNreSEmcF1gdqBiwwZWr6uRnWF5PisqaAGToEJ3doQUbnJo9ljVdXb
PgkkHBkP7h4fwbM7+hwYaREUNrZ9NkgTlBBtor2GYx/oWWczsmfgLb8/V/GSWIeP
htmO3vPVCMJamn57s5pm6BHz0N54s1OP5iMl2H0C2gtzVq9gXhkfCoADk8oz3ddX
MY7ZbQiDy6tj3oCa60N52+Rj4y1eHxk6aIQBHmHfAQ9qLuJbMaBqDrT37Rbr0IUp
oXrXhgIVxA==
=sz/s
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to