Debian Bug report logs - #1006707
python3.10 -m venv installs pip to incorrect path VENV_ROOT/local/bin/pip

version graph

Package: python3.10; Maintainer for python3.10 is (unknown);

Reported by: Anders Kaseorg <andersk@mit.edu>

Date: Thu, 3 Mar 2022 01:51:01 UTC

Severity: important

Tags: patch

Found in version python3.10/3.10.2-5

Fixed in version python3.10/3.10.2-6

Done: Matthias Klose <doko@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#1006707; Package python3.10. (Thu, 03 Mar 2022 01:51:03 GMT) (full text, mbox, link).


Acknowledgement sent to Anders Kaseorg <andersk@mit.edu>:
New Bug report received and forwarded. Copy sent to Matthias Klose <doko@debian.org>. (Thu, 03 Mar 2022 01:51:03 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Anders Kaseorg <andersk@mit.edu>
To: "submit@bugs.debian.org" <submit@bugs.debian.org>
Subject: python3.10 -m venv installs pip to incorrect path VENV_ROOT/local/bin/pip
Date: Thu, 3 Mar 2022 01:45:57 +0000
Package: python3.10
Version: 3.10.2-5
Severity: important

As of python3.10 3.10.2-3, python3.10 -m venv installs pip to the wrong path:

# apt update
# apt install python3.10-venv
# python3.10 -m venv /tmp/my-venv
# . /tmp/my-venv/bin/activate
# type pip
bash: type: pip: not found
# pip --version
bash: pip: command not found
# echo $PATH
/tmp/my-venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# ls /tmp/my-venv/bin
Activate.ps1  activate	activate.csh  activate.fish  python  python3  python3.10
# ls /tmp/my-venv/local/bin
pip  pip3  pip3.10

There’s a similar problem with virtualenv; although virtualenv still installs pip to the correct path, that pip installs other binaries to the wrong path:

# deactivate
# apt install python3-virtualenv
# virtualenv -p python3.10 /tmp/my-virtualenv
# /tmp/my-virtualenv/bin/pip install black
# . /tmp/my-virtualenv/bin/activate
# type black
bash: type: black: not found
# black --version
bash: black: command not found
# ls /tmp/my-virtualenv/local/bin
black  black-primer  blackd

This all worked correctly in 3.10.2-2.

# deactivate
# echo deb https://snapshot.debian.org/archive/debian/20220224T145813Z/ sid main >> /etc/apt/sources.list
# apt update
# apt install {libpython3.10-minimal,libpython3.10-stdlib,python3.10,python3.10-minimal,python3.10-venv}=3.10.2-2
# rm -rf /tmp/my-venv /tmp/my-virtualenv
# python3.10 -m venv /tmp/my-venv
# . /tmp/my-venv/bin/activate
# type pip
pip is /tmp/my-venv/bin/pip
# pip --version
pip 22.0.2 from /tmp/my-venv/lib/python3.10/site-packages/pip (python 3.10)
# deactivate
# virtualenv -p python3.10 /tmp/my-virtualenv
# /tmp/my-virtualenv/bin/pip install black
# . /tmp/my-virtualenv/bin/activate
# type black
black is /tmp/my-virtualenv/bin/black
# black --version
black, 22.1.0 (compiled: yes)



Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#1006707; Package python3.10. (Sun, 06 Mar 2022 00:09:02 GMT) (full text, mbox, link).


Acknowledgement sent to Anders Kaseorg <andersk@mit.edu>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>. (Sun, 06 Mar 2022 00:09:02 GMT) (full text, mbox, link).


Message #10 received at 1006707@bugs.debian.org (full text, mbox, reply):

From: Anders Kaseorg <andersk@mit.edu>
To: 1006707@bugs.debian.org
Cc: Matthias Klose <doko@debian.org>, Alexandre Ghiti <alex@ghiti.fr>, control@bugs.debian.org
Subject: Re: python3.10 -m venv installs pip to incorrect path VENV_ROOT/local/bin/pip
Date: Sat, 5 Mar 2022 19:06:07 -0500 (EST)
[Message part 1 (text/plain, inline)]
tags 1006707 + patch
thanks

sysconfig-debian-schemes.patch uses an incorrect test for a virtual 
environment:

if 'real_prefix' in sys.__dict__ or 'VIRTUAL_ENV' in os.environ:

Both sys.real_prefix and VIRTUAL_ENV are only set by virtualenv, not venv, 
and then only when the virtualenv is activated by VENV_ROOT/bin/activate, 
not when VENV_ROOT/bin/python is launched directly by its path.

This patch corrects the test to

if sys.base_prefix != sys.prefix:

which works on Python ≥ 3.3.

Anders
[python3.10_3.10.2-5_venv.debdiff (text/plain, attachment)]

Added tag(s) patch. Request was from Anders Kaseorg <andersk@mit.edu> to control@bugs.debian.org. (Sun, 06 Mar 2022 00:09:04 GMT) (full text, mbox, link).


Reply sent to Matthias Klose <doko@debian.org>:
You have taken responsibility. (Sun, 13 Mar 2022 06:51:08 GMT) (full text, mbox, link).


Notification sent to Anders Kaseorg <andersk@mit.edu>:
Bug acknowledged by developer. (Sun, 13 Mar 2022 06:51:08 GMT) (full text, mbox, link).


Message #17 received at 1006707-close@bugs.debian.org (full text, mbox, reply):

From: Debian FTP Masters <ftpmaster@ftp-master.debian.org>
To: 1006707-close@bugs.debian.org
Subject: Bug#1006707: fixed in python3.10 3.10.2-6
Date: Sun, 13 Mar 2022 06:48:42 +0000
Source: python3.10
Source-Version: 3.10.2-6
Done: Matthias Klose <doko@debian.org>

We believe that the bug you reported is fixed in the latest version of
python3.10, 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 1006707@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Matthias Klose <doko@debian.org> (supplier of updated python3.10 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 ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Sun, 13 Mar 2022 07:20:35 +0100
Source: python3.10
Architecture: source
Version: 3.10.2-6
Distribution: unstable
Urgency: medium
Maintainer: Matthias Klose <doko@debian.org>
Changed-By: Matthias Klose <doko@debian.org>
Closes: 1000188 1004149 1006707
Changes:
 python3.10 (3.10.2-6) unstable; urgency=medium
 .
   [ Matthias Klose ]
   * Update to the 3.10 branch 2022-03-13.
   * Add the test_multiprocessing_fork test to the failing autopkg tests,
     and run them with a 2h timeout.
   * Don't run the test_multiprocessing tests in the profile run.
 .
   [ Stefano Rivera ]
   * Re-add accidentally dropped /local/ to paths in distutils unix_local
     scheme.
   * Add missing /local/ to data path in sysconfig posix_local scheme.
     LP: #1964588.
   * Improve support for setuptools > 60's bundled distutils in
     _distutils_system_mod, supporting a wider range of versions and more
     reliably selecting the posix_local scheme. Closes: #1004149.
   * Use the same heuristics for scheme selection in sysconfig, as we use in
     distutils.command.install. Closes: #1006707, LP: #1962791.
   * Run the test suite with a 1hr timeout per module. Closes: #1000188.
Checksums-Sha1:
 520812e0fa30a967a859f9d830062758de2d641e 3500 python3.10_3.10.2-6.dsc
 8fcb0af43f75fef6a675518fba468c6fe425420c 341440 python3.10_3.10.2-6.debian.tar.xz
 a4b5dc66cd24edbe2607deff749595eb9a24d7b8 9655 python3.10_3.10.2-6_source.buildinfo
Checksums-Sha256:
 a8e931bead826226035ced517972238754ff9355a201d1e10ac50c71243ea199 3500 python3.10_3.10.2-6.dsc
 54222c7f45c4e92736ba1f3ceb6451d25ba5e30487ec4b04b989363039a3dd16 341440 python3.10_3.10.2-6.debian.tar.xz
 126cf1ba35c6417478203997e6d5d7c353335caf61897149538308a654c31207 9655 python3.10_3.10.2-6_source.buildinfo
Files:
 91b9253088865ef4d85bc7df2c1bc873 3500 python optional python3.10_3.10.2-6.dsc
 0c9de7e66c10dc5fe89cd1b0a96c5012 341440 python optional python3.10_3.10.2-6.debian.tar.xz
 3d1a317fc1bc5a9abf6fffa893c663ae 9655 python optional python3.10_3.10.2-6_source.buildinfo

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

iQJEBAEBCAAuFiEE1WVxuIqLuvFAv2PWvX6qYHePpvUFAmItjWgQHGRva29AZGVi
aWFuLm9yZwAKCRC9fqpgd4+m9dj4EACknbKMH5WU+I4pibp4+K73qCT2A34RSMdx
Ilv3lhzYB7/oUXbrsVoogkb5vq5JFYUwR4zQPqxgA0i11JvwaTVOJNG5vas9C9Gn
XvzDkcJ1VsQqsbJRU0J6HIP/5ZUNGgUAM61eSf9GSzQ/LUjNzSLU73s7EJKq4B8T
xtdlS4EWKDd7h0aDYUbnlnavdIhPyczdrJ5/MkiGxfL8CmxXZR5/KZ3PvMc6eAF5
Pd9KOSLsZbsBLkFxgjCNVWClIJjLEc0ofWNr6fSMQ0s8KBmKlCo12YVa9cT14wXt
Hs7662WU0qwvBUF92gXrWL9R4fLl92AQmkD+DVjWe8C4AKQhSItsdFQV+Z/nAtO8
3U8GvkA6ajgAdoRltmYi6fHbuNEKipwsfzKeVHCwXISPH2sdcUJVhalFrFTZeWTD
xBetSkw270Vx1IxIJb9u6ZNExKR4kqllB4aQbOL6T8arGQ2YVhh1lfY6BAlR0XAp
Ex5WFdqp1rJuemGARQoZ27tJStxqZsnx3/aeaP1pj6Sm+1kECrXIpoS+n7M9dCRS
vUGPHFf+mQoO+QpRN8l4z+Grsr8CQ7zXiCHswfZJ2h7YA/vaeNNWUM/WKHyfyVhI
wJwkYQJI/CuCqvKmdRGxBrfDDveTcvBnnq8/B/mvFGe2pbYMki5DSZSwCS76bssA
P+IDk+fmLw==
=j5v9
-----END PGP SIGNATURE-----




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Mon, 11 Apr 2022 07:24:44 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Aug 8 02:01:38 2024; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.