You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I found a bug but I'm not sure if tox or maybe virtualenv is guilty. I use python 3.8 but I'm sure the bug will also happen in other versions.
I started to use the site module of python because I found the devtools package and in the docs of it the site module was mentioned as a way to globally import the toolset or more specifically the debug() function which then can be used like print(). Instead of a sitecustomize.py file I use a usercustomize.py file. I don't know if this makes a difference but I don't think so.
I use tox to setup my dev venv and to be able to use this 'global import' of debug() I set sitepackages = True for the dev venv which in itself works but can create another bug #1570.
For information I added print('### Load User Customization') at the top of the usercustomize.py file which triggers the bug. You can see that at the 2nd line starting with ERROR: in the error output below. Somehow the output of the print gets appended to the path for the sys.prefix.
To recreate the bug you only need two files:
An usercustomize.py file at the right place with a print() statement printing something except an empty string. To find the right place call python -m site. The second last line starting with USER_SITE shows the path were to put the file.
Second you need a tox.ini (simplified to the issue):
$ tox -rvv -e dev
using tox.ini: /home/krys/Python_Projects/.testing/tox.ini (pid 112413)
removing /home/krys/Python_Projects/.testing/.tox/log
using tox-3.14.6 from /home/krys/.venvs/tox/lib/python3.8/site-packages/tox/__init__.py (pid 112413)
skipping sdist step
dev start: getenv /home/krys/Python_Projects/.testing/.tox/dev
dev cannot reuse: -r flag
dev create: /home/krys/Python_Projects/.testing/.tox/dev
dev uses /home/krys/.venvs/tox/bin/python3.8
removing /home/krys/Python_Projects/.testing/.tox/dev
setting PATH=/home/krys/Python_Projects/.testing/.tox/dev/bin:/home/krys/bin:/home/krys/.local/bin:/home/krys/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
[112417] /home/krys/Python_Projects/.testing/.tox$ /home/krys/.venvs/tox/bin/python3.8 -m virtualenv --system-site-packages --no-download --python /home/krys/.venvs/tox/bin/python3.8 dev
Already using interpreter /home/krys/.venvs/tox/bin/python3.8
Using base prefix '/usr'
New python executable in /home/krys/Python_Projects/.testing/.tox/dev/bin/python3.8
Also creating executable in /home/krys/Python_Projects/.testing/.tox/dev/bin/python
ERROR: The executable /home/krys/Python_Projects/.testing/.tox/dev/bin/python3.8 is not functioning
ERROR: It thinks sys.prefix is '/home/krys/Python_Projects/.testing/.tox/dev### Load User Customization' (should be '/home/krys/Python_Projects/.testing/.tox/dev')
ERROR: virtualenv is not compatible with this system or executable
ERROR: invocation failed (exit code 100)
ERROR: InvocationError for command /home/krys/.venvs/tox/bin/python3.8 -m virtualenv --system-site-packages --no-download --python /home/krys/.venvs/tox/bin/python3.8 dev (exited with code 100)
dev finish: getenv /home/krys/Python_Projects/.testing/.tox/dev after 0.09 seconds
___________________________________ summary ____________________________________
ERROR: dev: InvocationError for command /home/krys/.venvs/tox/bin/python3.8 -m virtualenv --system-site-packages --no-download --python /home/krys/.venvs/tox/bin/python3.8 dev (exited with code 100)
*** Exit Code: 1 ***
The text was updated successfully, but these errors were encountered:
Hi,
I found a bug but I'm not sure if tox or maybe virtualenv is guilty. I use python 3.8 but I'm sure the bug will also happen in other versions.
I started to use the
site
module of python because I found thedevtools
package and in the docs of it thesite
module was mentioned as a way to globally import the toolset or more specifically thedebug()
function which then can be used likeprint()
. Instead of asitecustomize.py
file I use ausercustomize.py
file. I don't know if this makes a difference but I don't think so.working
usercustomize.py
file:I use
tox
to setup my dev venv and to be able to use this 'global import' ofdebug()
I setsitepackages = True
for the dev venv which in itself works but can create another bug #1570.For information I added
print('### Load User Customization')
at the top of theusercustomize.py
file which triggers the bug. You can see that at the 2nd line starting withERROR:
in the error output below. Somehow the output of the print gets appended to the path for thesys.prefix
.To recreate the bug you only need two files:
An
usercustomize.py
file at the right place with aprint()
statement printing something except an empty string. To find the right place callpython -m site
. The second last line starting withUSER_SITE
shows the path were to put the file.Second you need a
tox.ini
(simplified to the issue):Then you can create the error message:
The text was updated successfully, but these errors were encountered: