Activity log for bug #1904945

Date Who What changed Old value New value Message
2020-11-20 00:09:09 mimosomal bug added bug
2021-01-21 00:31:26 Stefano Rivera nominated for series Ubuntu Focal
2021-01-21 00:31:26 Stefano Rivera bug task added python-virtualenv (Ubuntu Focal)
2021-01-21 00:31:33 Stefano Rivera python-virtualenv (Ubuntu): status New Fix Released
2021-01-21 00:31:37 Stefano Rivera python-virtualenv (Ubuntu Focal): status New Confirmed
2021-01-21 01:09:34 Alexander Skiba bug added subscriber Alexander Skiba
2021-01-21 03:03:55 Tonal bug added subscriber Tonal
2021-01-21 05:23:14 Ville Mattila bug added subscriber Ville Mattila
2021-01-27 04:17:05 Stefano Rivera attachment added python-pip_20.0.2-5ubuntu1.2.debdiff https://bugs.launchpad.net/ubuntu/+source/python-virtualenv/+bug/1904945/+attachment/5457223/+files/python-pip_20.0.2-5ubuntu1.2.debdiff
2021-01-27 04:19:41 Stefano Rivera attachment added python-virtualenv_20.0.17-1ubuntu0.1.debdiff https://bugs.launchpad.net/ubuntu/+source/python-virtualenv/+bug/1904945/+attachment/5457224/+files/python-virtualenv_20.0.17-1ubuntu0.1.debdiff
2021-01-27 04:20:00 Stefano Rivera bug task added python-pip (Ubuntu)
2021-01-27 04:20:08 Stefano Rivera python-pip (Ubuntu): status New Fix Released
2021-01-27 18:21:44 Stefano Rivera description Since updating to ubuntu 20.04, whenever I create a virtual environment with `virtualenv` it contains many unwanted libraries. Unsetting PYTHONPATH, setting the `--python` flag to a different version, etc does not fix the issue. I could run it with `--no-seed` but then the new venv doesn't even have pip. I found another user who has the exact same issue posting about it on stackoverflow and the list of packages which were installed by default is the same, this leads me to believe that something is wrong with the package itself and not a local config issue. `https://stackoverflow.com/q/62991007/5953826` This is the output from creating a virtualenv: ``` ➜ virtualenv --python=/usr/bin/python3.8 ~/projects/environments/test created virtual environment CPython3.8.5.final.0-64 in 156ms creator CPython3Posix(dest=/home/redacted/projects/environments/test, clear=False, global=False) seeder FromAppData(download=False, urllib3=latest, contextlib2=latest, idna=latest, ipaddr=latest, colorama=latest, pkg_resources=latest, webencodings=latest, pip=latest, progress=latest, setuptools=latest, retrying=latest, certifi=latest, chardet=latest, appdirs=latest, msgpack=latest, html5lib=latest, pytoml=latest, pyparsing=latest, distro=latest, CacheControl=latest, distlib=latest, pep517=latest, lockfile=latest, requests=latest, packaging=latest, six=latest, wheel=latest, via=copy, app_data_dir=/home/redacted/.local/share/virtualenv/seed-app-data/v1.0.1.debian) activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator ``` And these exact package versions are what get installed by default. ``` appdirs==1.4.3 CacheControl==0.12.6 certifi==2019.11.28 chardet==3.0.4 colorama==0.4.3 contextlib2==0.6.0 distlib==0.3.0 distro==1.4.0 html5lib==1.0.1 idna==2.8 ipaddr==2.2.0 lockfile==0.12.2 msgpack==0.6.2 packaging==20.3 pep517==0.8.2 progress==1.5 pyparsing==2.4.6 pytoml==0.1.21 requests==2.22.0 retrying==1.3.3 six==1.14.0 urllib3==1.25.8 webencodings==0.5.1 ``` All of the packages above are in the folder `~/.local/share/virtualenv/seed-app-data/v1.0.1.debian/3.8/wheels`, but removing ~/.local/share/virtualenv/seed-app-data does not fix the issue. It is recreated with the same packages. Creating a venv with `python3 -m venv path/to/venv` gives me a clean environment with no extra packages which is my current workaround. System Info: lsb_release -rd Description: Ubuntu 20.04.1 LTS Release: 20.04 apt-cache policy python3-virtualenv python3-virtualenv: Installed: 20.0.17-1 Candidate: 20.0.17-1 Version table: *** 20.0.17-1 500 500 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 Packages 500 http://us.archive.ubuntu.com/ubuntu focal/universe i386 Packages 100 /var/lib/dpkg/status ProblemType: Bug DistroRelease: Ubuntu 20.04 Package: python3-virtualenv 20.0.17-1 ProcVersionSignature: Ubuntu 5.4.0-53.59-generic 5.4.65 Uname: Linux 5.4.0-53-generic x86_64 NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair nvidia_modeset nvidia ApportVersion: 2.20.11-0ubuntu27.12 Architecture: amd64 CasperMD5CheckResult: skip CurrentDesktop: ubuntu:GNOME Date: Thu Nov 19 18:54:36 2020 InstallationDate: Installed on 2020-05-11 (192 days ago) InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423) PackageArchitecture: all ProcEnviron: TERM=xterm-256color PATH=(custom, no user) XDG_RUNTIME_DIR=<set> LANG=en_US.UTF-8 SHELL=/usr/bin/zsh SourcePackage: python-virtualenv UpgradeStatus: No upgrade log present (probably fresh install) [Impact] * Virtualenvs created on Ubuntu 20.04 are not as empty as they are expected to be. They are expected to contain pip and setuptools. But the way pip's vendored dependencies were de-vendored resulted in the libraries being exposed in the new virtualenv. This was a side-effect of packaging the (rewritten) virtualenv 20. It should have been resolved pre-release, but wasn't. * The behaviour is radically different to upstream virtualenv and not what was expected by Python developers. [Test Case] # apt install python3 virtualenv $ virtualenv -p python3 foo $ foo/bin/python -m pip freeze Should output nothing. In Ubuntu 20.04, it lists 24 packages. [Where problems could occur] * Anyone who has discovered this change and now expects it will be in for a surprise. I'd expect this to be rare, as there are workarounds instead (e.g. venv or upstream virtualenv). * The patch could have issues too. It is close to what is currently in Debian unstable & later Ubuntu releases, and seems to be working correctly. [Other Info] * See also LP: #1880749 which is fixed in the same patch. [Original Report] Since updating to ubuntu 20.04, whenever I create a virtual environment with `virtualenv` it contains many unwanted libraries. Unsetting PYTHONPATH, setting the `--python` flag to a different version, etc does not fix the issue. I could run it with `--no-seed` but then the new venv doesn't even have pip. I found another user who has the exact same issue posting about it on stackoverflow and the list of packages which were installed by default is the same, this leads me to believe that something is wrong with the package itself and not a local config issue. `https://stackoverflow.com/q/62991007/5953826` This is the output from creating a virtualenv: ``` ➜ virtualenv --python=/usr/bin/python3.8 ~/projects/environments/test created virtual environment CPython3.8.5.final.0-64 in 156ms   creator CPython3Posix(dest=/home/redacted/projects/environments/test, clear=False, global=False)   seeder FromAppData(download=False, urllib3=latest, contextlib2=latest, idna=latest, ipaddr=latest, colorama=latest, pkg_resources=latest, webencodings=latest, pip=latest, progress=latest, setuptools=latest, retrying=latest, certifi=latest, chardet=latest, appdirs=latest, msgpack=latest, html5lib=latest, pytoml=latest, pyparsing=latest, distro=latest, CacheControl=latest, distlib=latest, pep517=latest, lockfile=latest, requests=latest, packaging=latest, six=latest, wheel=latest, via=copy, app_data_dir=/home/redacted/.local/share/virtualenv/seed-app-data/v1.0.1.debian)   activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator ``` And these exact package versions are what get installed by default. ``` appdirs==1.4.3 CacheControl==0.12.6 certifi==2019.11.28 chardet==3.0.4 colorama==0.4.3 contextlib2==0.6.0 distlib==0.3.0 distro==1.4.0 html5lib==1.0.1 idna==2.8 ipaddr==2.2.0 lockfile==0.12.2 msgpack==0.6.2 packaging==20.3 pep517==0.8.2 progress==1.5 pyparsing==2.4.6 pytoml==0.1.21 requests==2.22.0 retrying==1.3.3 six==1.14.0 urllib3==1.25.8 webencodings==0.5.1 ``` All of the packages above are in the folder `~/.local/share/virtualenv/seed-app-data/v1.0.1.debian/3.8/wheels`, but removing ~/.local/share/virtualenv/seed-app-data does not fix the issue. It is recreated with the same packages. Creating a venv with `python3 -m venv path/to/venv` gives me a clean environment with no extra packages which is my current workaround. System Info: lsb_release -rd Description: Ubuntu 20.04.1 LTS Release: 20.04 apt-cache policy python3-virtualenv python3-virtualenv:   Installed: 20.0.17-1   Candidate: 20.0.17-1   Version table:  *** 20.0.17-1 500         500 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 Packages         500 http://us.archive.ubuntu.com/ubuntu focal/universe i386 Packages         100 /var/lib/dpkg/status ProblemType: Bug DistroRelease: Ubuntu 20.04 Package: python3-virtualenv 20.0.17-1 ProcVersionSignature: Ubuntu 5.4.0-53.59-generic 5.4.65 Uname: Linux 5.4.0-53-generic x86_64 NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair nvidia_modeset nvidia ApportVersion: 2.20.11-0ubuntu27.12 Architecture: amd64 CasperMD5CheckResult: skip CurrentDesktop: ubuntu:GNOME Date: Thu Nov 19 18:54:36 2020 InstallationDate: Installed on 2020-05-11 (192 days ago) InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423) PackageArchitecture: all ProcEnviron:  TERM=xterm-256color  PATH=(custom, no user)  XDG_RUNTIME_DIR=<set>  LANG=en_US.UTF-8  SHELL=/usr/bin/zsh SourcePackage: python-virtualenv UpgradeStatus: No upgrade log present (probably fresh install)
2021-01-28 18:37:44 Stefano Rivera bug added subscriber Ubuntu SRU Bot
2021-01-28 18:38:02 Stefano Rivera bug added subscriber Ubuntu Stable Release Updates Team
2021-01-28 18:38:05 Stefano Rivera removed subscriber Ubuntu SRU Bot
2021-02-09 11:46:58 Łukasz Zemczak python-pip (Ubuntu Focal): status New Fix Committed
2021-02-09 11:47:01 Łukasz Zemczak bug added subscriber SRU Verification
2021-02-09 11:47:05 Łukasz Zemczak tags amd64 apport-bug focal amd64 apport-bug focal verification-needed verification-needed-focal
2021-02-09 19:40:06 Stefano Rivera attachment added python-virtualenv_20.0.17-1ubuntu0.2.debdiff https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1904945/+attachment/5462002/+files/python-virtualenv_20.0.17-1ubuntu0.2.debdiff
2021-02-09 19:40:35 Stefano Rivera attachment added python-virtualenv_20.0.17-1ubuntu0.2.incremental.debdiff https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1904945/+attachment/5462003/+files/python-virtualenv_20.0.17-1ubuntu0.2.incremental.debdiff
2021-02-10 15:12:12 Łukasz Zemczak python-virtualenv (Ubuntu Focal): status Confirmed Fix Committed
2021-03-01 09:07:05 Mathew Hodson python-pip (Ubuntu): importance Undecided Medium
2021-03-01 09:07:07 Mathew Hodson python-pip (Ubuntu Focal): importance Undecided Medium
2021-03-01 09:07:11 Mathew Hodson python-virtualenv (Ubuntu): importance Undecided Medium
2021-03-01 09:07:13 Mathew Hodson python-virtualenv (Ubuntu Focal): importance Undecided Medium
2021-04-24 19:39:06 Stefano Rivera tags amd64 apport-bug focal verification-needed verification-needed-focal amd64 apport-bug focal verification-done verification-done-focal
2021-04-26 16:09:13 Launchpad Janitor python-pip (Ubuntu Focal): status Fix Committed Fix Released
2021-04-26 16:09:26 Łukasz Zemczak removed subscriber Ubuntu Stable Release Updates Team