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
diff -Nru python3.10-3.10.2/debian/changelog python3.10-3.10.2/debian/changelog
--- python3.10-3.10.2/debian/changelog  2022-02-26 08:21:15.000000000 +0000
+++ python3.10-3.10.2/debian/changelog  2022-03-05 23:50:26.000000000 +0000
@@ -1,3 +1,10 @@
+python3.10 (3.10.2-6) unstable; urgency=medium
+
+  * debian/patches/sysconfig-debian-schemes.patch: Correct the test for
+    virtual environments.  (Closes: #1006707, LP: #1962791)
+
+ -- Anders Kaseorg <ande...@mit.edu>  Sat, 05 Mar 2022 23:50:26 +0000
+
 python3.10 (3.10.2-5) unstable; urgency=medium
 
   * Fix the marshal test after applying the fix for #1004558.
diff -Nru python3.10-3.10.2/debian/patches/sysconfig-debian-schemes.diff 
python3.10-3.10.2/debian/patches/sysconfig-debian-schemes.diff
--- python3.10-3.10.2/debian/patches/sysconfig-debian-schemes.diff      
2022-02-14 16:46:56.000000000 +0000
+++ python3.10-3.10.2/debian/patches/sysconfig-debian-schemes.diff      
2022-03-05 23:50:26.000000000 +0000
@@ -45,7 +45,7 @@
              'user': 'osx_framework_user',
          }
 +
-+    if 'real_prefix' in sys.__dict__ or 'VIRTUAL_ENV' in os.environ:
++    if sys.base_prefix != sys.prefix:
 +        # virtual environments
 +        prefix_scheme = 'posix_prefix'
 +    else:

Reply via email to