FS#52944 - [python-virtualenv] module import warning on new python3 virtualenvs

Attached to Project: Arch Linux
Opened by Oscar Garcia (ogarcia) - Monday, 13 February 2017, 08:08 GMT
Last edited by Evangelos Foutras (foutrelis) - Saturday, 25 November 2017, 20:02 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Dan McGee (toofishes)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Simply cleate a new virtualenv:

% virtualenv test
Using base prefix '/usr'
New python executable in /tmp/test/bin/python3
Also creating executable in /tmp/test/bin/python
'import warnings' failed; traceback:
Traceback (most recent call last):
File "/tmp/test/lib/python3.6/warnings.py", line 505, in <module>
_processoptions(sys.warnoptions)
File "/tmp/test/lib/python3.6/warnings.py", line 186, in _processoptions
_setoption(arg)
File "/tmp/test/lib/python3.6/warnings.py", line 192, in _setoption
import re
File "/tmp/test/lib/python3.6/re.py", line 122, in <module>
import enum
ModuleNotFoundError: No module named 'enum'
Installing setuptools, pip, wheel...done.

As I can see, the symbolic link to /usr/lib/python3.6/enum.py is not present into virtualenv test/lib/python3.6. If I make the link by hand it works well.
This task depends upon

Closed by  Evangelos Foutras (foutrelis)
Saturday, 25 November 2017, 20:02 GMT
Reason for closing:  Fixed
Additional comments about closing:  python-virtualenv 15.1.0-1
Comment by Chih-Hsuan Yen (yan12125) - Monday, 13 February 2017, 18:48 GMT Comment by Chih-Hsuan Yen (yan12125) - Monday, 13 February 2017, 18:54 GMT
By the way, this bug occurs only if you use -W or PYTHONWARNINGS. For example:

$ env PYTHONWARNINGS=ignore virtualenv venv
Using base prefix '/usr'
New python executable in /home/yen/Projects/aur/venv/bin/python3
Also creating executable in /home/yen/Projects/aur/venv/bin/python
'import warnings' failed; traceback:
Traceback (most recent call last):
File "/home/yen/Projects/aur/venv/lib/python3.6/warnings.py", line 505, in <module>
_processoptions(sys.warnoptions)
File "/home/yen/Projects/aur/venv/lib/python3.6/warnings.py", line 186, in _processoptions
_setoption(arg)
File "/home/yen/Projects/aur/venv/lib/python3.6/warnings.py", line 192, in _setoption
import re
File "/home/yen/Projects/aur/venv/lib/python3.6/re.py", line 122, in <module>
import enum
ModuleNotFoundError: No module named 'enum'
Installing setuptools, pip, wheel...done.

Loading...