Skip to content
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

Closed
xflr6 opened this issue May 19, 2019 · 21 comments · Fixed by #1310
Closed

tox >= 3.10 py discover fails if space present in path #1306

xflr6 opened this issue May 19, 2019 · 21 comments · Fixed by #1310
Labels
bug:normal affects many people or has quite an impact help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted.

Comments

@xflr6
Copy link

xflr6 commented May 19, 2019

Since 3.10 running tests under tox seems to be broken under Windows (with 3.9, it does work):

$ py -m tox
(...)
Traceback (most recent call last):
  File "C:\Program Files\Python37\lib\site-packages\tox\interpreters.py", line 4
4, in get_info
    return self.executable2info[executable]
KeyError: '"C:\\Program Files\\Python27\\python.exe"'

During handling of the above exception, another exception occurred:
(...)
  File "C:\Program Files\Python37\lib\site-packages\tox\interpreters.py", line 4
6, in get_info
    info = run_and_get_interpreter_info(name, executable)
  File "C:\Program Files\Python37\lib\site-packages\tox\interpreters.py", line 6
6, in run_and_get_interpreter_info
    result = exec_on_interpreter(str(executable), VERSION_QUERY_SCRIPT)
  File "C:\Program Files\Python37\lib\site-packages\tox\interpreters.py", line 7
9, in exec_on_interpreter
    popen = Popen(args, stdout=PIPE, stderr=PIPE, universal_newlines=True)
  File "C:\Program Files\Python37\lib\subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "C:\Program Files\Python37\lib\subprocess.py", line 1178, in _execute_chi
ld
    startupinfo)
PermissionError: [WinError 5] Zugriff verweigert

Can this be related to the quotes?

>>> import pdb; pdb.pm()
> c:\program files\python37\lib\subprocess.py(1178)_execute_child()
-> startupinfo)
(Pdb) u
> c:\program files\python37\lib\subprocess.py(775)__init__()
-> restore_signals, start_new_session)
(Pdb)
> c:\program files\python37\lib\site-packages\tox\interpreters.py(79)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\\Python3
7\\lib\\site-packages\\tox\\helper\\get_version.py')

With Popen([args[0][1:-1], args[1]], ...), no PermissionError is raised, as oposed to Popen([args[0], args[1]], ...).

@xflr6 xflr6 added the bug:normal affects many people or has quite an impact label May 19, 2019
@gaborbernat
Copy link
Member

Can you post your tox.ini and the output to the -rvv, thanks!

@gaborbernat gaborbernat added the help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted. label May 19, 2019
@xflr6
Copy link
Author

xflr6 commented May 19, 2019

tox.ini:

[tox]
envlist = py{27,35,36,37}
skip_missing_interpreters = true

[testenv]
extras = test,visualization
commands = python -m pytest {posargs}

Full output:

C:\Users\User\Desktop\python-bitsets>py -m tox -rvv
using tox.ini: C:\Users\User\Desktop\python-bitsets\tox.ini (pid 3688)
using tox-3.10.0 from C:\Program Files\Python37\lib\site-packages\tox\__init__.p
y (pid 3688)
GLOB start: packaging
GLOB sdist-make: C:\Users\User\Desktop\python-bitsets\setup.py
[6208] C:\Users\User\Desktop\python-bitsets$ 'C:\Program Files\Python37\python.e
xe' setup.py sdist --formats=zip --dist-dir 'C:\Users\User\Desktop\python-bitset
s\.tox\dist' >.tox\log\GLOB-0.log
running sdist
running egg_info
creating bitsets.egg-info
writing bitsets.egg-info\PKG-INFO
writing dependency_links to bitsets.egg-info\dependency_links.txt
writing requirements to bitsets.egg-info\requires.txt
writing top-level names to bitsets.egg-info\top_level.txt
writing manifest file 'bitsets.egg-info\SOURCES.txt'
reading manifest file 'bitsets.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'docs\_build'
writing manifest file 'bitsets.egg-info\SOURCES.txt'
running check
creating bitsets-0.7.15.dev0
creating bitsets-0.7.15.dev0\bitsets
creating bitsets-0.7.15.dev0\bitsets.egg-info
creating bitsets-0.7.15.dev0\docs
creating bitsets-0.7.15.dev0\docs\_static
creating bitsets-0.7.15.dev0\tests
copying files to bitsets-0.7.15.dev0...
copying CHANGES.txt -> bitsets-0.7.15.dev0
copying LICENSE.txt -> bitsets-0.7.15.dev0
copying MANIFEST.in -> bitsets-0.7.15.dev0
copying README.rst -> bitsets-0.7.15.dev0
copying requirements.txt -> bitsets-0.7.15.dev0
copying run-tests.py -> bitsets-0.7.15.dev0
copying setup.cfg -> bitsets-0.7.15.dev0
copying setup.py -> bitsets-0.7.15.dev0
copying tox.ini -> bitsets-0.7.15.dev0
copying visualize-examples.py -> bitsets-0.7.15.dev0
copying bitsets\__init__.py -> bitsets-0.7.15.dev0\bitsets
copying bitsets\_compat.py -> bitsets-0.7.15.dev0\bitsets
copying bitsets\bases.py -> bitsets-0.7.15.dev0\bitsets
copying bitsets\combos.py -> bitsets-0.7.15.dev0\bitsets
copying bitsets\integers.py -> bitsets-0.7.15.dev0\bitsets
copying bitsets\meta.py -> bitsets-0.7.15.dev0\bitsets
copying bitsets\series.py -> bitsets-0.7.15.dev0\bitsets
copying bitsets\transform.py -> bitsets-0.7.15.dev0\bitsets
copying bitsets\visualize.py -> bitsets-0.7.15.dev0\bitsets
copying bitsets.egg-info\PKG-INFO -> bitsets-0.7.15.dev0\bitsets.egg-info
copying bitsets.egg-info\SOURCES.txt -> bitsets-0.7.15.dev0\bitsets.egg-info
copying bitsets.egg-info\dependency_links.txt -> bitsets-0.7.15.dev0\bitsets.egg
-info
copying bitsets.egg-info\requires.txt -> bitsets-0.7.15.dev0\bitsets.egg-info
copying bitsets.egg-info\top_level.txt -> bitsets-0.7.15.dev0\bitsets.egg-info
copying docs\advanced.rst -> bitsets-0.7.15.dev0\docs
copying docs\api.rst -> bitsets-0.7.15.dev0\docs
copying docs\changelog.rst -> bitsets-0.7.15.dev0\docs
copying docs\conf.py -> bitsets-0.7.15.dev0\docs
copying docs\hasse-bits.png -> bitsets-0.7.15.dev0\docs
copying docs\hasse-members.png -> bitsets-0.7.15.dev0\docs
copying docs\index.rst -> bitsets-0.7.15.dev0\docs
copying docs\license.rst -> bitsets-0.7.15.dev0\docs
copying docs\manual.rst -> bitsets-0.7.15.dev0\docs
copying docs\requirements.txt -> bitsets-0.7.15.dev0\docs
copying docs\_static\hasse-bits.svg -> bitsets-0.7.15.dev0\docs\_static
copying docs\_static\hasse-members.svg -> bitsets-0.7.15.dev0\docs\_static
copying tests\conftest.py -> bitsets-0.7.15.dev0\tests
copying tests\test_bases.py -> bitsets-0.7.15.dev0\tests
copying tests\test_init.py -> bitsets-0.7.15.dev0\tests
copying tests\test_meta.py -> bitsets-0.7.15.dev0\tests
copying tests\test_series.py -> bitsets-0.7.15.dev0\tests
copying tests\test_visualize.py -> bitsets-0.7.15.dev0\tests
Writing bitsets-0.7.15.dev0\setup.cfg
creating C:\Users\User\Desktop\python-bitsets\.tox\dist
creating 'C:\Users\User\Desktop\python-bitsets\.tox\dist\bitsets-0.7.15.dev0.zip
' and adding 'bitsets-0.7.15.dev0' to it
adding 'bitsets-0.7.15.dev0'
adding 'bitsets-0.7.15.dev0\bitsets'
adding 'bitsets-0.7.15.dev0\bitsets.egg-info'
adding 'bitsets-0.7.15.dev0\docs'
adding 'bitsets-0.7.15.dev0\tests'
adding 'bitsets-0.7.15.dev0\CHANGES.txt'
adding 'bitsets-0.7.15.dev0\LICENSE.txt'
adding 'bitsets-0.7.15.dev0\MANIFEST.in'
adding 'bitsets-0.7.15.dev0\PKG-INFO'
adding 'bitsets-0.7.15.dev0\README.rst'
adding 'bitsets-0.7.15.dev0\requirements.txt'
adding 'bitsets-0.7.15.dev0\run-tests.py'
adding 'bitsets-0.7.15.dev0\setup.cfg'
adding 'bitsets-0.7.15.dev0\setup.py'
adding 'bitsets-0.7.15.dev0\tox.ini'
adding 'bitsets-0.7.15.dev0\visualize-examples.py'
adding 'bitsets-0.7.15.dev0\bitsets\bases.py'
adding 'bitsets-0.7.15.dev0\bitsets\combos.py'
adding 'bitsets-0.7.15.dev0\bitsets\integers.py'
adding 'bitsets-0.7.15.dev0\bitsets\meta.py'
adding 'bitsets-0.7.15.dev0\bitsets\series.py'
adding 'bitsets-0.7.15.dev0\bitsets\transform.py'
adding 'bitsets-0.7.15.dev0\bitsets\visualize.py'
adding 'bitsets-0.7.15.dev0\bitsets\_compat.py'
adding 'bitsets-0.7.15.dev0\bitsets\__init__.py'
adding 'bitsets-0.7.15.dev0\bitsets.egg-info\dependency_links.txt'
adding 'bitsets-0.7.15.dev0\bitsets.egg-info\PKG-INFO'
adding 'bitsets-0.7.15.dev0\bitsets.egg-info\requires.txt'
adding 'bitsets-0.7.15.dev0\bitsets.egg-info\SOURCES.txt'
adding 'bitsets-0.7.15.dev0\bitsets.egg-info\top_level.txt'
adding 'bitsets-0.7.15.dev0\docs\_static'
adding 'bitsets-0.7.15.dev0\docs\advanced.rst'
adding 'bitsets-0.7.15.dev0\docs\api.rst'
adding 'bitsets-0.7.15.dev0\docs\changelog.rst'
adding 'bitsets-0.7.15.dev0\docs\conf.py'
adding 'bitsets-0.7.15.dev0\docs\hasse-bits.png'
adding 'bitsets-0.7.15.dev0\docs\hasse-members.png'
adding 'bitsets-0.7.15.dev0\docs\index.rst'
adding 'bitsets-0.7.15.dev0\docs\license.rst'
adding 'bitsets-0.7.15.dev0\docs\manual.rst'
adding 'bitsets-0.7.15.dev0\docs\requirements.txt'
adding 'bitsets-0.7.15.dev0\docs\_static\hasse-bits.svg'
adding 'bitsets-0.7.15.dev0\docs\_static\hasse-members.svg'
adding 'bitsets-0.7.15.dev0\tests\conftest.py'
adding 'bitsets-0.7.15.dev0\tests\test_bases.py'
adding 'bitsets-0.7.15.dev0\tests\test_init.py'
adding 'bitsets-0.7.15.dev0\tests\test_meta.py'
adding 'bitsets-0.7.15.dev0\tests\test_series.py'
adding 'bitsets-0.7.15.dev0\tests\test_visualize.py'
removing 'bitsets-0.7.15.dev0' (and everything under it)

GLOB finish: packaging  after 3.17 seconds
copying new sdistfile to 'C:\\Users\\User\\.tox\\distshare\\bitsets-0.7.15.dev0.
zip'
package .tmp\package\1\bitsets-0.7.15.dev0.zip links to dist\bitsets-0.7.15.dev0
.zip (C:\Users\User\Desktop\python-bitsets\.tox)
py27 start: getenv C:\Users\User\Desktop\python-bitsets\.tox\py27
py27 cannot reuse: -r flag
py27 create: C:\Users\User\Desktop\python-bitsets\.tox\py27
py27 uses "C:\Program Files\Python27\python.exe"
___________________________________ summary ___________________________________
  py27: commands succeeded
ERROR:   py35: undefined
ERROR:   py36: undefined
ERROR:   py37: undefined
cleanup C:\Users\User\Desktop\python-bitsets\.tox\.tmp\package\1\bitsets-0.7.15.
dev0.zip
Traceback (most recent call last):
  File "C:\Program Files\Python37\lib\site-packages\tox\interpreters.py", line 4
4, in get_info
    return self.executable2info[executable]
KeyError: '"C:\\Program Files\\Python27\\python.exe"'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\Python37\lib\runpy.py", line 193, in _run_module_as_mai
n
    "__main__", mod_spec)
  File "C:\Program Files\Python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Program Files\Python37\lib\site-packages\tox\__main__.py", line 4, in
 <module>
    tox.cmdline()
  File "C:\Program Files\Python37\lib\site-packages\tox\session\__init__.py", li
ne 42, in cmdline
    main(args)
  File "C:\Program Files\Python37\lib\site-packages\tox\session\__init__.py", li
ne 66, in main
    exit_code = session.runcommand()
  File "C:\Program Files\Python37\lib\site-packages\tox\session\__init__.py", li
ne 190, in runcommand
    return self.subcommand_test()
  File "C:\Program Files\Python37\lib\site-packages\tox\session\__init__.py", li
ne 218, in subcommand_test
    run_sequential(self.config, self.venv_dict)
  File "C:\Program Files\Python37\lib\site-packages\tox\session\commands\run\seq
uential.py", line 9, in run_sequential
    if venv.setupenv():
  File "C:\Program Files\Python37\lib\site-packages\tox\venv.py", line 584, in s
etupenv
    status = self.update(action=action)
  File "C:\Program Files\Python37\lib\site-packages\tox\venv.py", line 242, in u
pdate
    self.hook.tox_testenv_create(action=action, venv=self)
  File "C:\Program Files\Python37\lib\site-packages\pluggy\hooks.py", line 289,
in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "C:\Program Files\Python37\lib\site-packages\pluggy\manager.py", line 68,
 in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "C:\Program Files\Python37\lib\site-packages\pluggy\manager.py", line 62,
 in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "C:\Program Files\Python37\lib\site-packages\pluggy\callers.py", line 208
, in _multicall
    return outcome.get_result()
  File "C:\Program Files\Python37\lib\site-packages\pluggy\callers.py", line 80,
 in get_result
    raise ex[1].with_traceback(ex[2])
  File "C:\Program Files\Python37\lib\site-packages\pluggy\callers.py", line 187
, in _multicall
    res = hook_impl.function(*args)
  File "C:\Program Files\Python37\lib\site-packages\tox\venv.py", line 654, in t
ox_testenv_create
    config_interpreter = venv.getsupportedinterpreter()
  File "C:\Program Files\Python37\lib\site-packages\tox\venv.py", line 283, in g
etsupportedinterpreter
    return self.envconfig.getsupportedinterpreter()
  File "C:\Program Files\Python37\lib\site-packages\tox\config\__init__.py", lin
e 952, in getsupportedinterpreter
    info = self.config.interpreters.get_info(envconfig=self)
  File "C:\Program Files\Python37\lib\site-packages\tox\interpreters.py", line 4
6, in get_info
    info = run_and_get_interpreter_info(name, executable)
  File "C:\Program Files\Python37\lib\site-packages\tox\interpreters.py", line 6
6, in run_and_get_interpreter_info
    result = exec_on_interpreter(str(executable), VERSION_QUERY_SCRIPT)
  File "C:\Program Files\Python37\lib\site-packages\tox\interpreters.py", line 7
9, in exec_on_interpreter
    popen = Popen(args, stdout=PIPE, stderr=PIPE, universal_newlines=True)
  File "C:\Program Files\Python37\lib\subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "C:\Program Files\Python37\lib\subprocess.py", line 1178, in _execute_chi
ld
    startupinfo)
PermissionError: [WinError 5] Zugriff verweigert

@gaborbernat
Copy link
Member

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!

@xflr6
Copy link
Author

xflr6 commented May 22, 2019

Seems we get execution denied while trying to run "C:\Program Files\Python27\python.exe", interesting where the quotes come from.

+1 (see also the pdb session in the initial post above).

AFAICT, its the same with 3.11.1:

tox 3.11.1 results
C:\Users\User\Desktop\python-bitsets>py -m tox -rvv
using tox.ini: C:\Users\User\Desktop\python-bitsets\tox.ini (pid 6716)
  removing C:\Users\User\Desktop\python-bitsets\.tox\log
using tox-3.11.1 from C:\Program Files\Python37\lib\site-packages\tox\__init__.p
y (pid 6716)
GLOB start: packaging
GLOB sdist-make: C:\Users\User\Desktop\python-bitsets\setup.py
  removing C:\Users\User\Desktop\python-bitsets\.tox\dist
[2308] C:\Users\User\Desktop\python-bitsets$ 'C:\Program Files\Python37\python.e
xe' setup.py sdist --formats=zip --dist-dir '.tox\dist' >.tox\log\GLOB-0.log
running sdist
running egg_info
writing bitsets.egg-info\PKG-INFO
writing dependency_links to bitsets.egg-info\dependency_links.txt
writing requirements to bitsets.egg-info\requires.txt
writing top-level names to bitsets.egg-info\top_level.txt
reading manifest file 'bitsets.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'docs\_build'
writing manifest file 'bitsets.egg-info\SOURCES.txt'
running check
creating bitsets-0.7.15.dev0
creating bitsets-0.7.15.dev0\bitsets
creating bitsets-0.7.15.dev0\bitsets.egg-info
creating bitsets-0.7.15.dev0\docs
creating bitsets-0.7.15.dev0\docs\_static
creating bitsets-0.7.15.dev0\tests
copying files to bitsets-0.7.15.dev0...
copying CHANGES.txt -> bitsets-0.7.15.dev0
copying LICENSE.txt -> bitsets-0.7.15.dev0
copying MANIFEST.in -> bitsets-0.7.15.dev0
copying README.rst -> bitsets-0.7.15.dev0
copying requirements.txt -> bitsets-0.7.15.dev0
copying run-tests.py -> bitsets-0.7.15.dev0
copying setup.cfg -> bitsets-0.7.15.dev0
copying setup.py -> bitsets-0.7.15.dev0
copying tox.ini -> bitsets-0.7.15.dev0
copying visualize-examples.py -> bitsets-0.7.15.dev0
copying bitsets\__init__.py -> bitsets-0.7.15.dev0\bitsets
copying bitsets\_compat.py -> bitsets-0.7.15.dev0\bitsets
copying bitsets\bases.py -> bitsets-0.7.15.dev0\bitsets
copying bitsets\combos.py -> bitsets-0.7.15.dev0\bitsets
copying bitsets\integers.py -> bitsets-0.7.15.dev0\bitsets
copying bitsets\meta.py -> bitsets-0.7.15.dev0\bitsets
copying bitsets\series.py -> bitsets-0.7.15.dev0\bitsets
copying bitsets\transform.py -> bitsets-0.7.15.dev0\bitsets
copying bitsets\visualize.py -> bitsets-0.7.15.dev0\bitsets
copying bitsets.egg-info\PKG-INFO -> bitsets-0.7.15.dev0\bitsets.egg-info
copying bitsets.egg-info\SOURCES.txt -> bitsets-0.7.15.dev0\bitsets.egg-info
copying bitsets.egg-info\dependency_links.txt -> bitsets-0.7.15.dev0\bitsets.egg
-info
copying bitsets.egg-info\requires.txt -> bitsets-0.7.15.dev0\bitsets.egg-info
copying bitsets.egg-info\top_level.txt -> bitsets-0.7.15.dev0\bitsets.egg-info
copying docs\advanced.rst -> bitsets-0.7.15.dev0\docs
copying docs\api.rst -> bitsets-0.7.15.dev0\docs
copying docs\changelog.rst -> bitsets-0.7.15.dev0\docs
copying docs\conf.py -> bitsets-0.7.15.dev0\docs
copying docs\hasse-bits.png -> bitsets-0.7.15.dev0\docs
copying docs\hasse-members.png -> bitsets-0.7.15.dev0\docs
copying docs\index.rst -> bitsets-0.7.15.dev0\docs
copying docs\license.rst -> bitsets-0.7.15.dev0\docs
copying docs\manual.rst -> bitsets-0.7.15.dev0\docs
copying docs\requirements.txt -> bitsets-0.7.15.dev0\docs
copying docs\_static\hasse-bits.svg -> bitsets-0.7.15.dev0\docs\_static
copying docs\_static\hasse-members.svg -> bitsets-0.7.15.dev0\docs\_static
copying tests\conftest.py -> bitsets-0.7.15.dev0\tests
copying tests\test_bases.py -> bitsets-0.7.15.dev0\tests
copying tests\test_init.py -> bitsets-0.7.15.dev0\tests
copying tests\test_meta.py -> bitsets-0.7.15.dev0\tests
copying tests\test_series.py -> bitsets-0.7.15.dev0\tests
copying tests\test_visualize.py -> bitsets-0.7.15.dev0\tests
Writing bitsets-0.7.15.dev0\setup.cfg
creating '.tox\dist\bitsets-0.7.15.dev0.zip' and adding 'bitsets-0.7.15.dev0' to
 it
adding 'bitsets-0.7.15.dev0'
adding 'bitsets-0.7.15.dev0\bitsets'
adding 'bitsets-0.7.15.dev0\bitsets.egg-info'
adding 'bitsets-0.7.15.dev0\docs'
adding 'bitsets-0.7.15.dev0\tests'
adding 'bitsets-0.7.15.dev0\CHANGES.txt'
adding 'bitsets-0.7.15.dev0\LICENSE.txt'
adding 'bitsets-0.7.15.dev0\MANIFEST.in'
adding 'bitsets-0.7.15.dev0\PKG-INFO'
adding 'bitsets-0.7.15.dev0\README.rst'
adding 'bitsets-0.7.15.dev0\requirements.txt'
adding 'bitsets-0.7.15.dev0\run-tests.py'
adding 'bitsets-0.7.15.dev0\setup.cfg'
adding 'bitsets-0.7.15.dev0\setup.py'
adding 'bitsets-0.7.15.dev0\tox.ini'
adding 'bitsets-0.7.15.dev0\visualize-examples.py'
adding 'bitsets-0.7.15.dev0\bitsets\bases.py'
adding 'bitsets-0.7.15.dev0\bitsets\combos.py'
adding 'bitsets-0.7.15.dev0\bitsets\integers.py'
adding 'bitsets-0.7.15.dev0\bitsets\meta.py'
adding 'bitsets-0.7.15.dev0\bitsets\series.py'
adding 'bitsets-0.7.15.dev0\bitsets\transform.py'
adding 'bitsets-0.7.15.dev0\bitsets\visualize.py'
adding 'bitsets-0.7.15.dev0\bitsets\_compat.py'
adding 'bitsets-0.7.15.dev0\bitsets\__init__.py'
adding 'bitsets-0.7.15.dev0\bitsets.egg-info\dependency_links.txt'
adding 'bitsets-0.7.15.dev0\bitsets.egg-info\PKG-INFO'
adding 'bitsets-0.7.15.dev0\bitsets.egg-info\requires.txt'
adding 'bitsets-0.7.15.dev0\bitsets.egg-info\SOURCES.txt'
adding 'bitsets-0.7.15.dev0\bitsets.egg-info\top_level.txt'
adding 'bitsets-0.7.15.dev0\docs\_static'
adding 'bitsets-0.7.15.dev0\docs\advanced.rst'
adding 'bitsets-0.7.15.dev0\docs\api.rst'
adding 'bitsets-0.7.15.dev0\docs\changelog.rst'
adding 'bitsets-0.7.15.dev0\docs\conf.py'
adding 'bitsets-0.7.15.dev0\docs\hasse-bits.png'
adding 'bitsets-0.7.15.dev0\docs\hasse-members.png'
adding 'bitsets-0.7.15.dev0\docs\index.rst'
adding 'bitsets-0.7.15.dev0\docs\license.rst'
adding 'bitsets-0.7.15.dev0\docs\manual.rst'
adding 'bitsets-0.7.15.dev0\docs\requirements.txt'
adding 'bitsets-0.7.15.dev0\docs\_static\hasse-bits.svg'
adding 'bitsets-0.7.15.dev0\docs\_static\hasse-members.svg'
adding 'bitsets-0.7.15.dev0\tests\conftest.py'
adding 'bitsets-0.7.15.dev0\tests\test_bases.py'
adding 'bitsets-0.7.15.dev0\tests\test_init.py'
adding 'bitsets-0.7.15.dev0\tests\test_meta.py'
adding 'bitsets-0.7.15.dev0\tests\test_series.py'
adding 'bitsets-0.7.15.dev0\tests\test_visualize.py'
removing 'bitsets-0.7.15.dev0' (and everything under it)

GLOB finish: packaging  after 1.62 seconds
copying new sdistfile to 'C:\\Users\\User\\.tox\\distshare\\bitsets-0.7.15.dev0.
zip'
package .tmp\package\1\bitsets-0.7.15.dev0.zip links to dist\bitsets-0.7.15.dev0
.zip (C:\Users\User\Desktop\python-bitsets\.tox)
py27 start: getenv C:\Users\User\Desktop\python-bitsets\.tox\py27
py27 cannot reuse: -r flag
py27 create: C:\Users\User\Desktop\python-bitsets\.tox\py27
py27 uses "C:\Program Files\Python27\python.exe"
___________________________________ summary ___________________________________
  py27: commands succeeded
ERROR:   py35: undefined
ERROR:   py36: undefined
ERROR:   py37: undefined
cleanup C:\Users\User\Desktop\python-bitsets\.tox\.tmp\package\1\bitsets-0.7.15.
dev0.zip
Traceback (most recent call last):
  File "C:\Program Files\Python37\lib\site-packages\tox\interpreters.py", line 4
4, in get_info
    return self.executable2info[executable]
KeyError: '"C:\\Program Files\\Python27\\python.exe"'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\Python37\lib\runpy.py", line 193, in _run_module_as_mai
n
    "__main__", mod_spec)
  File "C:\Program Files\Python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Program Files\Python37\lib\site-packages\tox\__main__.py", line 4, in
 <module>
    tox.cmdline()
  File "C:\Program Files\Python37\lib\site-packages\tox\session\__init__.py", li
ne 42, in cmdline
    main(args)
  File "C:\Program Files\Python37\lib\site-packages\tox\session\__init__.py", li
ne 66, in main
    exit_code = session.runcommand()
  File "C:\Program Files\Python37\lib\site-packages\tox\session\__init__.py", li
ne 190, in runcommand
    return self.subcommand_test()
  File "C:\Program Files\Python37\lib\site-packages\tox\session\__init__.py", li
ne 218, in subcommand_test
    run_sequential(self.config, self.venv_dict)
  File "C:\Program Files\Python37\lib\site-packages\tox\session\commands\run\seq
uential.py", line 9, in run_sequential
    if venv.setupenv():
  File "C:\Program Files\Python37\lib\site-packages\tox\venv.py", line 584, in s
etupenv
    status = self.update(action=action)
  File "C:\Program Files\Python37\lib\site-packages\tox\venv.py", line 242, in u
pdate
    self.hook.tox_testenv_create(action=action, venv=self)
  File "C:\Program Files\Python37\lib\site-packages\pluggy\hooks.py", line 289,
in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "C:\Program Files\Python37\lib\site-packages\pluggy\manager.py", line 68,
 in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "C:\Program Files\Python37\lib\site-packages\pluggy\manager.py", line 62,
 in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "C:\Program Files\Python37\lib\site-packages\pluggy\callers.py", line 208
, in _multicall
    return outcome.get_result()
  File "C:\Program Files\Python37\lib\site-packages\pluggy\callers.py", line 80,
 in get_result
    raise ex[1].with_traceback(ex[2])
  File "C:\Program Files\Python37\lib\site-packages\pluggy\callers.py", line 187
, in _multicall
    res = hook_impl.function(*args)
  File "C:\Program Files\Python37\lib\site-packages\tox\venv.py", line 654, in t
ox_testenv_create
    config_interpreter = venv.getsupportedinterpreter()
  File "C:\Program Files\Python37\lib\site-packages\tox\venv.py", line 283, in g
etsupportedinterpreter
    return self.envconfig.getsupportedinterpreter()
  File "C:\Program Files\Python37\lib\site-packages\tox\config\__init__.py", lin
e 953, in getsupportedinterpreter
    info = self.config.interpreters.get_info(envconfig=self)
  File "C:\Program Files\Python37\lib\site-packages\tox\interpreters.py", line 4
6, in get_info
    info = run_and_get_interpreter_info(name, executable)
  File "C:\Program Files\Python37\lib\site-packages\tox\interpreters.py", line 6
6, in run_and_get_interpreter_info
    result = exec_on_interpreter(str(executable), VERSION_QUERY_SCRIPT)
  File "C:\Program Files\Python37\lib\site-packages\tox\interpreters.py", line 8
0, in exec_on_interpreter
    popen = Popen(args, stdout=PIPE, stderr=PIPE, universal_newlines=True)
  File "C:\Program Files\Python37\lib\subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "C:\Program Files\Python37\lib\subprocess.py", line 1178, in _execute_chi
ld
    startupinfo)


PermissionError: [WinError 5] Zugriff verweigert
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

@gaborbernat
Copy link
Member

Try -rvv with this config:

[tox]
envlist = py{27,35,36,37}
skip_missing_interpreters = true

[testenv]
extras = test,visualization
commands = python -m pytest {posargs}
description = {basepython} is {envpython}

@xflr6
Copy link
Author

xflr6 commented May 22, 2019

Same result (description is not shown in the log).

@xflr6
Copy link
Author

xflr6 commented May 22, 2019

Installing 3.9 and adding import pdb; pdb.set_trace() here, confirms that previously, the first element of args did not include quotes:

> 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')

@gaborbernat
Copy link
Member

gaborbernat commented May 22, 2019

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!

GitHub
Command line driven CI frontend and development task automation tool - tox-dev/tox

@xflr6
Copy link
Author

xflr6 commented May 22, 2019

Sure, from locate_via_py() (src), so this is probably from e9b90e8 (#1286), WDYT?

> c:\program files\python37\lib\site-packages\tox\interpreters.py(217)tox_get_py
thon_executable()
-> py_exe = locate_via_py(spec)
(Pdb) n
> c:\program files\python37\lib\site-packages\tox\interpreters.py(218)tox_get_py
thon_executable()
-> if py_exe is not None:
(Pdb) py_exe
'"C:\\Program Files\\Python27\\python.exe"'

@xflr6
Copy link
Author

xflr6 commented May 22, 2019

C:\Users\User>py -0p
Installed Pythons found by py Launcher for Windows
 -3.7-64        "C:\Program Files\Python37\python.exe" *
 -2.7-64        "C:\Program Files\Python27\python.exe"
In [1]: import subprocess
   ...: subprocess.call(['"C:\Program Files\Python27\python.exe"'])
---------------------------------------------------------------------------
PermissionError                           Traceback (most recent call last)
(...)
PermissionError: [WinError 5] Zugriff verweigert

@gaborbernat
Copy link
Member

gaborbernat commented May 22, 2019

Ah, this is a valid bug in our tokenization 🤔 https://github.com/tox-dev/tox/blob/master/src/tox/interpreters.py#L261

GitHub
Command line driven CI frontend and development task automation tool - tox-dev/tox

@gaborbernat
Copy link
Member

 -3.7-64	C:\hostedtoolcache\windows\Python\3.7.2\x64\python.exe
 -3.7-32	C:\hostedtoolcache\windows\Python\3.7.2\x86\python.exe
 -3.6-64	C:\hostedtoolcache\windows\Python\3.6.8\x64\python.exe
 -3.6-32	C:\hostedtoolcache\windows\Python\3.6.8\x86\python.exe
C:\Users\User>py -0p
Installed Pythons found by py Launcher for Windows
 -3.7-64        "C:\Program Files\Python37\python.exe" *
 -2.7-64        "C:\Program Files\Python27\python.exe"

Turns out if you have space the paths are quoted, otherwise not 🤦‍♂

@gaborbernat gaborbernat changed the title tox >= 3.10 fails with PermissionError under Windows tox >= 3.10 py fails if space present May 22, 2019
@gaborbernat gaborbernat changed the title tox >= 3.10 py fails if space present tox >= 3.10 py discover fails if space present in path May 22, 2019
@gaborbernat
Copy link
Member

Will try to do a fix inside #1310 ... Will try to release it by tomorrow, thanks!

@gaborbernat
Copy link
Member

@xflr6 did you remove the tabs when generating py -0p? Seems to me should be there, and also strange why the Installed Pythons found by py Launcher for Windows is there 🤔

@xflr6
Copy link
Author

xflr6 commented May 22, 2019

Thanks, AFAIK, the default (system-wide) Python 3 install directory on Windows contains a space.

did you remove the tabs when generating py -0p

That probably stems from cmd.exe normalizing whitespace when copy/pasting:

>>> 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 Installed Pythons found by py Launcher for Windows part seems to go to stderr (also the asterisk):

>>> 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 ('*') in the output? Honestly, I am not so sure if the output is supposed to be machine readable (and can be trusted to be stable).

See also: https://docs.python.org/3/whatsnew/3.7.html#windows-only-changes

The launcher can be run as py -0 to produce a list of the installed pythons, with default marked with an asterisk.

More specifically here is the relevant source:
https://github.com/python/cpython/blob/8c77b8cb9188165a123f2512026e3629bf03dc9b/PC/launcher.c#L1447-L1471

GitHub
The Python programming language. Contribute to python/cpython development by creating an account on GitHub.

@xflr6
Copy link
Author

xflr6 commented May 22, 2019

Ah, okay, maybe this comment indicates it is safe to rely on the stdout. :)

@gaborbernat
Copy link
Member

gaborbernat commented May 22, 2019

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.

Twitter
@gjbernat @brettsky PEP 514 on Windows is stable. Not sure if anything beyond searching $PATH for pythonX.Y names is there for POSIX yet.”

@gaborbernat
Copy link
Member

gaborbernat commented May 22, 2019

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.

GitHub
virtualenv management and test command line tool. Contribute to gaborbernat/tox development by creating an account on GitHub.

@helpr helpr bot added the pr-available label May 22, 2019
@xflr6
Copy link
Author

xflr6 commented May 22, 2019

Thanks, this works:

C:\Users\User\Desktop\tox>py -m virtualenv .venv
(...)
(.venv) C:\Users\User\Desktop\tox>pip install -e .
(...)
(.venv) C:\Users\User\Desktop\python-bitsets>tox --version
3.5.1.dev144+ge9b90e8 imported from c:\users\user\desktop\tox\src\tox\__init__.py
(.venv) C:\Users\User\Desktop\python-bitsets>tox -r
(...)
  py27: commands succeeded
SKIPPED:  py35: InterpreterNotFound: python3.5
SKIPPED:  py36: InterpreterNotFound: python3.6
  py37: commands succeeded
  congratulations :)
>>> 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 __repr__ of PythonSpec is round-tripable, e.g. by changing this to something along the following lines:

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)

@gaborbernat
Copy link
Member

released via 3.12.0, thanks for your contribution
thanks

@xflr6
Copy link
Author

xflr6 commented May 24, 2019

Thanks for the quick fix. :)

@tox-dev tox-dev locked and limited conversation to collaborators Jan 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug:normal affects many people or has quite an impact help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants