Package: virtualenvwrapper
Version: 4.3.1-2
Severity: important

Dear Maintainer,

after upgrading system-wide Python installation (in my case from 3.5.3 to 
3.5.4),
virtualenvs may break due to the outdated interpreter 
(somevirtualenv/bin/python3) inside the venv, trying to work with a newer 
stdlib.

The problem is that mkvirtualenv copies rather than symlinks the python 
interpreter binary, but symlinks the modules from standard library (e.g. 
/usr/lib/python3.5).
Whenever python3.5 is updated in the system (e.g. via apt), the virtualenv is 
pointed at newer library (i.e. 3.5.4), but still uses the old interpreter 
(3.5.3), breaking compatibility.



Reproduction:

1. install python3.5 = 3.5.3
2. make some virtualenv using /usr/bin/python3.5 ($ mkvirtualenv -p 
/usr/bin/python3.5 somevirtualenv)
3. upgrade python3.5 to 3.5.4
4. enter the virtualenv ($ workon somevirtualenv)
5. open python3 ($ python3)
6. try importing an incompatible module (>>> import ctypes)

Import threw exception:
ImportError: 
/home/elegant/virtualenvs/rpi2casterd/lib/python3.5/lib-dynload/_ctypes.cpython-35m-x86_64-linux-gnu.so:
 undefined symbol: _PyUnicode_AsWideCharString

Breaks anything that depends on it as well, making the virtualenv unusable 
until it's fixed.



Workaround:
1. $ cd $WORKON_HOME/somevirtualenv/bin
2. $ mv python3 python3_old (put the old interpreter out of the way)
3. $ ln -s /usr/bin/python3.5 python3 (symlink the newer python3.5 from system)
4. $ workon somevirtualenv
5. $ python3
>>> import ctypes

(everything OK)



-- System Information:
Debian Release: buster/sid
  APT prefers testing
  APT policy: (900, 'testing'), (600, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, armhf

Kernel: Linux 4.13.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=pl_PL.UTF-8, LC_CTYPE=pl_PL.UTF-8 (charmap=UTF-8), 
LANGUAGE=pl_PL.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages virtualenvwrapper depends on:
ii  libjs-sphinxdoc    1.6.5-2
ii  python             2.7.14-3
ii  python-stevedore   1.25.0-2
ii  python-virtualenv  15.1.0+ds-1
ii  virtualenv         15.1.0+ds-1
ii  virtualenv-clone   0.2.5-1

Versions of packages virtualenvwrapper recommends:
ii  bash-completion  1:2.1-4.3

virtualenvwrapper suggests no packages.

-- no debconf information

Reply via email to