-
-
Notifications
You must be signed in to change notification settings - Fork 531
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tox >= 3.10 py discover fails if space present in path #1306
Comments
Can you post your tox.ini and the output to the |
[tox]
envlist = py{27,35,36,37}
skip_missing_interpreters = true
[testenv]
extras = test,visualization
commands = python -m pytest {posargs} Full output:
|
Seems we get execution denied while trying to run "C:\Program Files\Python27\python.exe", interesting where the quotes come from. 🤔 Can you please rerun with 3.11.1, and also attach the output of --showconfig separately. Thanks! |
+1 (see also the AFAICT, its the same with tox 3.11.1 results
py -m tox --showconfig[tox]
args = ['--showconfig']
distdir = C:\Users\User\Desktop\python-bitsets\.tox\dist
distshare = C:\Users\User\.tox\distshare
envlist_default = ['py27', 'py35', 'py36', 'py37']
hashseed = 486
homedir = C:\Users\User
ignore_basepython_conflict = False
indexserver = {'default': IndexServerConfig(name=default, url=None)}
invocationcwd = C:\Users\User\Desktop\python-bitsets
isolated_build = False
isolated_build_env = .package
logdir = C:\Users\User\Desktop\python-bitsets\.tox\log
minversion = None
option = Namespace(alwayscopy=False, args=[], configfile=None, develop=False, en
v=None, force_dep=None, hashseed=None, help=False, helpini=False, indexurl=None,
installpkg=None, listenvs=False, listenvs_all=False, notest=False, parallel=0,
parallel_live=False, parallel_safe_build=False, pre=False, quiet_level=0, recrea
te=False, resultjson=None, sdistonly=False, showconfig=True, sitepackages=False,
skip_missing_interpreters='true', verbose_level=0, version=False, workdir=None)
provision_tox_env = .tox
run_provision = False
sdistsrc = None
setupdir = C:\Users\User\Desktop\python-bitsets
skipsdist = False
temp_dir = C:\Users\User\Desktop\python-bitsets\.tox\.tmp
toxinidir = C:\Users\User\Desktop\python-bitsets
toxinipath = C:\Users\User\Desktop\python-bitsets\tox.ini
toxworkdir = C:\Users\User\Desktop\python-bitsets\.tox
host_python = C:\Program Files\Python37\python.exe
[tox:versions]
tox = 3.11.1
py = 1.8.0
filelock = 3.0.12
six = 1.12.0
virtualenv = 16.6.0
toml = 0.10.0
pluggy = 0.11.0
setuptools = 41.0.1
[testenv:py27]
envdir = C:\Users\User\Desktop\python-bitsets\.tox\py27
setenv = SetenvDict: {'PYTHONHASHSEED': '486', 'TOX_ENV_NAME': 'py27', 'TOX_ENV_
DIR': 'C:\\Users\\User\\Desktop\\python-bitsets\\.tox\\py27'}
basepython = python2.7
description =
envtmpdir = C:\Users\User\Desktop\python-bitsets\.tox\py27\tmp
envlogdir = C:\Users\User\Desktop\python-bitsets\.tox\py27\log
downloadcache = None
changedir = C:\Users\User\Desktop\python-bitsets
args_are_paths = True
skip_install = False
ignore_errors = False
recreate = False
passenv = {'LANG', 'PATHEXT', 'TMP', 'MSYSTEM', 'TOX_PARALLEL_ENV', 'NUMBER_OF_P
ROCESSORS', 'TOX_WORK_DIR', 'LANGUAGE', 'SYSTEMDRIVE', 'SYSTEMROOT', 'PROCESSOR_
ARCHITECTURE', 'TEMP', 'COMSPEC', 'PATH', 'TOX_REPORTER_TIMESTAMP', 'LD_LIBRARY_
PATH', 'PIP_INDEX_URL', 'USERPROFILE'}
whitelist_externals = []
platform = .*
sitepackages = False
download = False
alwayscopy = False
pip_pre = False
usedevelop = False
install_command = ['python', '-m', 'pip', 'install', '{opts}', '{packages}']
list_dependencies_command = ['python', '-m', 'pip', 'freeze']
deps = []
commands = [['python', '-m', 'pytest']]
commands_pre = []
commands_post = []
ignore_outcome = False
extras = ['test,visualization']
depends = ()
parallel_show_output = False
[testenv:py35]
envdir = C:\Users\User\Desktop\python-bitsets\.tox\py35
setenv = SetenvDict: {'PYTHONHASHSEED': '486', 'TOX_ENV_NAME': 'py35', 'TOX_ENV_
DIR': 'C:\\Users\\User\\Desktop\\python-bitsets\\.tox\\py35'}
basepython = python3.5
description =
envtmpdir = C:\Users\User\Desktop\python-bitsets\.tox\py35\tmp
envlogdir = C:\Users\User\Desktop\python-bitsets\.tox\py35\log
downloadcache = None
changedir = C:\Users\User\Desktop\python-bitsets
args_are_paths = True
skip_install = False
ignore_errors = False
recreate = False
passenv = {'LANG', 'PATHEXT', 'TMP', 'MSYSTEM', 'TOX_PARALLEL_ENV', 'NUMBER_OF_P
ROCESSORS', 'TOX_WORK_DIR', 'LANGUAGE', 'SYSTEMDRIVE', 'SYSTEMROOT', 'PROCESSOR_
ARCHITECTURE', 'TEMP', 'COMSPEC', 'PATH', 'TOX_REPORTER_TIMESTAMP', 'LD_LIBRARY_
PATH', 'PIP_INDEX_URL', 'USERPROFILE'}
whitelist_externals = []
platform = .*
sitepackages = False
download = False
alwayscopy = False
pip_pre = False
usedevelop = False
install_command = ['python', '-m', 'pip', 'install', '{opts}', '{packages}']
list_dependencies_command = ['python', '-m', 'pip', 'freeze']
deps = []
commands = [['python', '-m', 'pytest']]
commands_pre = []
commands_post = []
ignore_outcome = False
extras = ['test,visualization']
depends = ()
parallel_show_output = False
[testenv:py36]
envdir = C:\Users\User\Desktop\python-bitsets\.tox\py36
setenv = SetenvDict: {'PYTHONHASHSEED': '486', 'TOX_ENV_NAME': 'py36', 'TOX_ENV_
DIR': 'C:\\Users\\User\\Desktop\\python-bitsets\\.tox\\py36'}
basepython = python3.6
description =
envtmpdir = C:\Users\User\Desktop\python-bitsets\.tox\py36\tmp
envlogdir = C:\Users\User\Desktop\python-bitsets\.tox\py36\log
downloadcache = None
changedir = C:\Users\User\Desktop\python-bitsets
args_are_paths = True
skip_install = False
ignore_errors = False
recreate = False
passenv = {'LANG', 'PATHEXT', 'TMP', 'MSYSTEM', 'TOX_PARALLEL_ENV', 'NUMBER_OF_P
ROCESSORS', 'TOX_WORK_DIR', 'LANGUAGE', 'SYSTEMDRIVE', 'SYSTEMROOT', 'PROCESSOR_
ARCHITECTURE', 'TEMP', 'COMSPEC', 'PATH', 'TOX_REPORTER_TIMESTAMP', 'LD_LIBRARY_
PATH', 'PIP_INDEX_URL', 'USERPROFILE'}
whitelist_externals = []
platform = .*
sitepackages = False
download = False
alwayscopy = False
pip_pre = False
usedevelop = False
install_command = ['python', '-m', 'pip', 'install', '{opts}', '{packages}']
list_dependencies_command = ['python', '-m', 'pip', 'freeze']
deps = []
commands = [['python', '-m', 'pytest']]
commands_pre = []
commands_post = []
ignore_outcome = False
extras = ['test,visualization']
depends = ()
parallel_show_output = False
[testenv:py37]
envdir = C:\Users\User\Desktop\python-bitsets\.tox\py37
setenv = SetenvDict: {'PYTHONHASHSEED': '486', 'TOX_ENV_NAME': 'py37', 'TOX_ENV_
DIR': 'C:\\Users\\User\\Desktop\\python-bitsets\\.tox\\py37'}
basepython = python3.7
description =
envtmpdir = C:\Users\User\Desktop\python-bitsets\.tox\py37\tmp
envlogdir = C:\Users\User\Desktop\python-bitsets\.tox\py37\log
downloadcache = None
changedir = C:\Users\User\Desktop\python-bitsets
args_are_paths = True
skip_install = False
ignore_errors = False
recreate = False
passenv = {'LANG', 'PATHEXT', 'TMP', 'MSYSTEM', 'TOX_PARALLEL_ENV', 'NUMBER_OF_P
ROCESSORS', 'TOX_WORK_DIR', 'LANGUAGE', 'SYSTEMDRIVE', 'SYSTEMROOT', 'PROCESSOR_
ARCHITECTURE', 'TEMP', 'COMSPEC', 'PATH', 'TOX_REPORTER_TIMESTAMP', 'LD_LIBRARY_
PATH', 'PIP_INDEX_URL', 'USERPROFILE'}
whitelist_externals = []
platform = .*
sitepackages = False
download = False
alwayscopy = False
pip_pre = False
usedevelop = False
install_command = ['python', '-m', 'pip', 'install', '{opts}', '{packages}']
list_dependencies_command = ['python', '-m', 'pip', 'freeze']
deps = []
commands = [['python', '-m', 'pytest']]
commands_pre = []
commands_post = []
ignore_outcome = False
extras = ['test,visualization']
depends = ()
parallel_show_output = False |
Try -rvv with this config:
|
Same result ( |
Installing > c:\program files\python37\lib\site-packages\tox\interpreters.py(76)exec_on_int
erpreter()
-> popen = Popen(args, stdout=PIPE, stderr=PIPE, universal_newlines=True)
(Pdb) args
args = ('C:\\Program Files\\Python27\\python.exe', 'C:\\Program Files\\Python37\
\lib\\site-packages\\tox\\helper\\get_version.py') |
Can you step through https://github.com/tox-dev/tox/blob/master/src/tox/interpreters.py#L207 in 3.11 to see where the quotes come in? Thanks!
|
Sure, from
|
In [1]: import subprocess
...: subprocess.call(['"C:\Program Files\Python27\python.exe"'])
---------------------------------------------------------------------------
PermissionError Traceback (most recent call last)
(...)
PermissionError: [WinError 5] Zugriff verweigert |
Ah, this is a valid bug in our tokenization 🤔 https://github.com/tox-dev/tox/blob/master/src/tox/interpreters.py#L261
|
Turns out if you have space the paths are quoted, otherwise not 🤦♂ |
Will try to do a fix inside #1310 ... Will try to release it by tomorrow, thanks! |
@xflr6 did you remove the tabs when generating |
Thanks, AFAIK, the default (system-wide) Python 3 install directory on Windows contains a space.
That probably stems from >>> subprocess.check_output(['py', '-0p'])
b'\r\n -3.7-64\t"C:\\Program Files\\Python37\\python.exe"\r\n -2.7-64\t"C:\\Program Files\\Python27\\python.exe"' The >>> subprocess.check_output(['py', '-0p'], stderr=subprocess.STDOUT)
b'Installed Pythons found by py Launcher for Windows *\r\n\r\n\r\n -3.7-64\t"C:\\Program Files\\Python37\\python.exe"\r\n -2.7-64\t"C:\\Program Files\\Python27\\python.exe"' BTW, does _call_py account for the asterisk ( See also: https://docs.python.org/3/whatsnew/3.7.html#windows-only-changes
More specifically here is the relevant source:
|
Ah, okay, maybe this comment indicates it is safe to rely on the |
That was my impression too, but according to https://twitter.com/zooba/status/1131198020945473537 the Windows registry is the only stable thing we can work for now. I'll need to rework to use winreg instead. |
A first draft implementation is ready under https://github.com/gaborbernat/tox/tree/py, give it a spin if you have some free time for it.
|
Thanks, this works:
>>> import tox.pep514
>>> list(tox.pep514.discover_pythons())
[PythonSpec(name=python, major=2, minor=7, architecture=64, path=C:\Program File
s\Python27\python.exe, args=None), PythonSpec(name=python, major=3, minor=7, arc
hitecture=64, path=C:\Program Files\Python37\python.exe, args=None)] Its probably a bit nicer if the return ("{0.__class__.__name__}(name={0.name!r}, major={0.major!r}, minor={0.minor!r}, "
"architecure={0.architecture!r}, path={0.path!r}, args={0.args!r})").format(self) Example output: PythonSpec(name='python', major=2, minor=7, architecture=64, path='C:\\Program Files\\Python27\\python.exe', args=None) |
Thanks for the quick fix. :) |
Since 3.10 running tests under
tox
seems to be broken under Windows (with 3.9, it does work):Can this be related to the quotes?
With
Popen([args[0][1:-1], args[1]], ...)
, noPermissionError
is raised, as oposed toPopen([args[0], args[1]], ...)
.The text was updated successfully, but these errors were encountered: