[Python-modules-team] Bug#956144: virtualenv: caching of debian wheels breaks pip-installed virtualenv
Anthony Sottile
asottile+debian at umich.edu
Tue Apr 7 20:47:10 BST 2020
Package: virtualenv
Version: 20.0.16-1
Severity: normal
Tags: patch
Reproduction:
```bash
apt update && apt install -y --no-install-recommends virtualenv
virtualenv venv
venv/bin/pip install virtualenv
venv/bin/virtualenv venv2
venv2/bin/pip install astpretty
```
This was originally reported here: https://github.com/pre-commit/pre-commit/issues/1383
The root cause is virtualenv's appdata cache is poisoned by the debian patched
wheels which results in all invocations by unpatched virtualenv failing by
using debian's cache. My proposal is to separate debian's cache from the
normal name to prevent this collision. Here's a patch to the installed code
which fixes this issue:
```diff
--- /usr/lib/python3/dist-packages/virtualenv/seed/via_app_data/via_app_data.py.old 2020-04-07 19:41:09.613187290 +0000
+++ /usr/lib/python3/dist-packages/virtualenv/seed/via_app_data/via_app_data.py2020-04-07 19:41:17.601187290 +0000
@@ -18,7 +18,7 @@
def __init__(self, options):
super(FromAppData, self).__init__(options)
self.symlinks = options.symlink_app_data
- self.base_cache = self.app_data / "seed-app-data" / "v1.0.1"
+ self.base_cache = self.app_data / "seed-app-data" / "v1.0.1.debian"
@classmethod
def add_parser_arguments(cls, parser, interpreter, app_data):
```
-- System Information:
Debian Release: bullseye/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 4.15.0-91-generic (SMP w/2 CPU cores)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE=C (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: unable to detect
Versions of packages virtualenv depends on:
ii python3-virtualenv 20.0.16-1
virtualenv recommends no packages.
virtualenv suggests no packages.
-- no debconf information
More information about the Python-modules-team
mailing list