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

White space in path causes tox to fail with "No such file or directory" #121

Closed
pytoxbot opened this issue Sep 17, 2016 · 26 comments
Closed
Labels
bug:upstream something does not behave as it should, but can't or shouldn't be fixed in tox, but in a dependency

Comments

@pytoxbot
Copy link

As shown below, if the path to the source program are white space (in this case the spaces), the "tox" does not work and throws this error.

When I moved the source to the directory "/home/wojciech/django-money" then the "tox" works.

#!python

django-money$ tox
GLOB sdist-make: /home/wojciech/Aptana Studio 3 Workspace/django-money/setup.py
py27 create: /home/wojciech/Aptana Studio 3 Workspace/django-money/.tox/py27
py27 installdeps: -r"/home/wojciech/Aptana Studio 3 Workspace/django-money/requirements.txt"
Traceback (most recent call last):
  File "/home/wojciech/.pyenv/versions/2.7.5/bin/tox", line 9, in <module>
    load_entry_point('tox==1.6.0', 'console_scripts', 'tox')()
  File "/home/wojciech/.pyenv/versions/2.7.5/lib/python2.7/site-packages/tox/_cmdline.py", line 26, in main
    retcode = Session(config).runcommand()
  File "/home/wojciech/.pyenv/versions/2.7.5/lib/python2.7/site-packages/tox/_cmdline.py", line 301, in runcommand
    return self.subcommand_test()
  File "/home/wojciech/.pyenv/versions/2.7.5/lib/python2.7/site-packages/tox/_cmdline.py", line 433, in subcommand_test
    if self.setupenv(venv):
  File "/home/wojciech/.pyenv/versions/2.7.5/lib/python2.7/site-packages/tox/_cmdline.py", line 358, in setupenv
    status = venv.update(action=action)
  File "/home/wojciech/.pyenv/versions/2.7.5/lib/python2.7/site-packages/tox/_venv.py", line 142, in update
    self.install_deps(action)
  File "/home/wojciech/.pyenv/versions/2.7.5/lib/python2.7/site-packages/tox/_venv.py", line 272, in install_deps
    self._install(deps, action=action)
  File "/home/wojciech/.pyenv/versions/2.7.5/lib/python2.7/site-packages/tox/_venv.py", line 330, in _install
    extraenv=extraenv)
  File "/home/wojciech/.pyenv/versions/2.7.5/lib/python2.7/site-packages/tox/_venv.py", line 303, in run_install_command
    extraenv=env, action=action)
  File "/home/wojciech/.pyenv/versions/2.7.5/lib/python2.7/site-packages/tox/_venv.py", line 378, in _pcall
    return action.popen(args, cwd=cwd, env=env, redirect=redirect)
  File "/home/wojciech/.pyenv/versions/2.7.5/lib/python2.7/site-packages/tox/_cmdline.py", line 96, in popen
    popen = self._popen(args, cwd, env=env, stdout=f, stderr=STDOUT)
  File "/home/wojciech/.pyenv/versions/2.7.5/lib/python2.7/site-packages/tox/_cmdline.py", line 153, in _popen
    stdout=stdout, stderr=stderr, env=env)
  File "/home/wojciech/.pyenv/versions/2.7.5/lib/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/home/wojciech/.pyenv/versions/2.7.5/lib/python2.7/subprocess.py", line 1308, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

@pytoxbot
Copy link
Author

Original comment by olintsmith

This is essentially the same issue as #66; it is fixed by pull request #172.

@pytoxbot
Copy link
Author

Original comment by ross_hemsley

This still seems to be a problem:

This makes it impossible to run tox from inside a Sublime Text plugin directory, because that path always has spaces (due to Application Support dir on mac)

@ssteinerx
Copy link

Just ran into this on another project. I thought this had been solved in a general way like 10 years ago...

@obestwalter
Copy link
Member

@ssteinerx can confirm:

tox                                                      (git)-[mau mau/master:177d0a0718fe ]
static develop-inst-nodeps: /home/oliver/work/codecats/mau mau
ERROR: invocation failed (errno 2), args: ['/home/oliver/work/codecats/mau mau/.tox/static/bin/pip', 'install', '--no-deps', '-e', '/home/oliver/work/codecats/mau mau'], cwd: /home/oliver/work/codecats/mau mau
Traceback (most recent call last):
  File "/opt/pyenv/versions/tmp/bin/tox", line 11, in <module>
    sys.exit(cmdline())
  File "/opt/pyenv/versions/3.4.4/envs/tmp/lib/python3.4/site-packages/tox/session.py", line 39, in main
    retcode = Session(config).runcommand()
  File "/opt/pyenv/versions/3.4.4/envs/tmp/lib/python3.4/site-packages/tox/session.py", line 390, in runcommand
    return self.subcommand_test()
  File "/opt/pyenv/versions/3.4.4/envs/tmp/lib/python3.4/site-packages/tox/session.py", line 543, in subcommand_test
    self.developpkg(venv, self.config.setupdir)
  File "/opt/pyenv/versions/3.4.4/envs/tmp/lib/python3.4/site-packages/tox/session.py", line 472, in developpkg
    venv.developpkg(setupdir, action)
  File "/opt/pyenv/versions/3.4.4/envs/tmp/lib/python3.4/site-packages/tox/venv.py", line 237, in developpkg
    self._install(['-e', setupdir], extraopts=extraopts, action=action)
  File "/opt/pyenv/versions/3.4.4/envs/tmp/lib/python3.4/site-packages/tox/venv.py", line 305, in _install
    action=action)
  File "/opt/pyenv/versions/3.4.4/envs/tmp/lib/python3.4/site-packages/tox/venv.py", line 278, in run_install_command
    redirect=self.session.report.verbosity < 2)
  File "/opt/pyenv/versions/3.4.4/envs/tmp/lib/python3.4/site-packages/tox/venv.py", line 384, in _pcall
    redirect=redirect, ignore_ret=ignore_ret)
  File "/opt/pyenv/versions/3.4.4/envs/tmp/lib/python3.4/site-packages/tox/session.py", line 140, in popen
    stdout=stdout, stderr=STDOUT)
  File "/opt/pyenv/versions/3.4.4/envs/tmp/lib/python3.4/site-packages/tox/session.py", line 228, in _popen
    stdout=stdout, stderr=stderr, env=env)
  File "/opt/pyenv/versions/3.4.4/lib/python3.4/subprocess.py", line 859, in __init__
    restore_signals, start_new_session)
  File "/opt/pyenv/versions/3.4.4/lib/python3.4/subprocess.py", line 1463, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: '/home/oliver/work/codecats/mau mau/.tox/static/bin/pip'

@obestwalter
Copy link
Member

obestwalter commented Mar 10, 2017

Might be reasonable to tackle together with #203 and #291

@pawelad
Copy link

pawelad commented Mar 18, 2017

So. I looked into it but unfortunately with no luck.

Don't know if it will be in any way helpful but what I found was:

  • when opening the file named in FileNotFoundError: [Errno 2] No such file or directory: ' ... ' in Python console, everything works like it's supposed to (without space escaping)
  • when opening the above file in terminal (i.e. vim) it doesn't work because the space isn't escaped

My guess would be that the above is the reason because we're using subprocess. So, I tried to escape the strings via pipes.quote but it didn't help.

I then added simple printing statement on one step of the stacktrace to see what I was dealing with:

# tox/session.py:222

...

    def _popen(self, args, cwd, stdout, stderr, env=None):
        print(args)
        for a in args:
            print(a, type(a))
        args = self._rewriteargs(cwd, args)
        if env is None:
            env = os.environ.copy()
        return self.session.popen(args, shell=False, cwd=str(cwd),
                                  universal_newlines=True,
                                  stdout=stdout, stderr=stderr, env=env)
...

and the output:

# tox -v
using tox.ini: /Users/pawelad/Temp/test space/tox.ini
using tox-2.6.0 from /Users/pawelad/.pyenv/versions/3.4.6/envs/py34/lib/python3.4/site-packages/tox/__init__.py
GLOB sdist-make: /Users/pawelad/Temp/test space/setup.py
['/Users/pawelad/.pyenv/versions/3.4.6/envs/py34/bin/python', local('/Users/pawelad/Temp/test space/setup.py'), 'sdist', '--formats=zip', '--dist-dir', local('/Users/pawelad/Temp/test space/.tox/dist')]
/Users/pawelad/.pyenv/versions/3.4.6/envs/py34/bin/python <class 'str'>
/Users/pawelad/Temp/test space/setup.py <class 'py._path.local.LocalPath'>
sdist <class 'str'>
--formats=zip <class 'str'>
--dist-dir <class 'str'>
/Users/pawelad/Temp/test space/.tox/dist <class 'py._path.local.LocalPath'>
  /Users/pawelad/Temp/test space$ /Users/pawelad/.pyenv/versions/3.4.6/envs/py34/bin/python /Users/pawelad/Temp/test space/setup.py sdist --formats=zip --dist-dir /Users/pawelad/Temp/test space/.tox/dist >/Users/pawelad/Temp/test space/.tox/log/tox-0.log
py34 reusing: /Users/pawelad/Temp/test space/.tox/py34
py34 inst-nodeps: /Users/pawelad/Temp/test space/.tox/dist/UNKNOWN-0.0.0.zip
Traceback (most recent call last):
  File "/Users/pawelad/.pyenv/versions/py34/bin/tox", line 11, in <module>
    sys.exit(cmdline())
  File "/Users/pawelad/.pyenv/versions/3.4.6/envs/py34/lib/python3.4/site-packages/tox/session.py", line 40, in main
    retcode = Session(config).runcommand()
  File "/Users/pawelad/.pyenv/versions/3.4.6/envs/py34/lib/python3.4/site-packages/tox/session.py", line 397, in runcommand
    return self.subcommand_test()
  File "/Users/pawelad/.pyenv/versions/3.4.6/envs/py34/lib/python3.4/site-packages/tox/session.py", line 554, in subcommand_test
    self.installpkg(venv, path)
  File "/Users/pawelad/.pyenv/versions/3.4.6/envs/py34/lib/python3.4/site-packages/tox/session.py", line 497, in installpkg
    venv.installpkg(path, action)
  File "/Users/pawelad/.pyenv/versions/3.4.6/envs/py34/lib/python3.4/site-packages/tox/venv.py", line 258, in installpkg
    self._install([sdistpath], extraopts=extraopts, action=action)
  File "/Users/pawelad/.pyenv/versions/3.4.6/envs/py34/lib/python3.4/site-packages/tox/venv.py", line 311, in _install
    action=action)
  File "/Users/pawelad/.pyenv/versions/3.4.6/envs/py34/lib/python3.4/site-packages/tox/venv.py", line 284, in run_install_command
    redirect=self.session.report.verbosity < 2)
  File "/Users/pawelad/.pyenv/versions/3.4.6/envs/py34/lib/python3.4/site-packages/tox/venv.py", line 390, in _pcall
    redirect=redirect, ignore_ret=ignore_ret)
  File "/Users/pawelad/.pyenv/versions/3.4.6/envs/py34/lib/python3.4/site-packages/tox/session.py", line 141, in popen
    stdout=stdout, stderr=STDOUT)
  File "/Users/pawelad/.pyenv/versions/3.4.6/envs/py34/lib/python3.4/site-packages/tox/session.py", line 227, in _popen
    print(args)
  File "/Users/pawelad/.pyenv/versions/3.4.6/lib/python3.4/codecs.py", line 374, in write
    self.stream.write(data)
TypeError: must be str, not bytes

So, it correctly printed the first time:

['/Users/pawelad/.pyenv/versions/3.4.6/envs/py34/bin/python', local('/Users/pawelad/Temp/test space/setup.py'), 'sdist', '--formats=zip', '--dist-dir', local('/Users/pawelad/Temp/test space/.tox/dist')]
/Users/pawelad/.pyenv/versions/3.4.6/envs/py34/bin/python <class 'str'>
/Users/pawelad/Temp/test space/setup.py <class 'py._path.local.LocalPath'>
sdist <class 'str'>
--formats=zip <class 'str'>
--dist-dir <class 'str'>
/Users/pawelad/Temp/test space/.tox/dist <class 'py._path.local.LocalPath'>

but it crashed on the second one with the bizarro TypeError: must be str, not bytes error, that BTW is also present in #426

Via Reporter.logpopen() though, we know that the command that's causing all this (both the bug and the inability to print) is:

/Users/pawelad/Temp/test space$ /Users/pawelad/.pyenv/versions/3.4.6/envs/py34/bin/python /Users/pawelad/Temp/test space/setup.py sdist --formats=zip --dist-dir /Users/pawelad/Temp/test space/.tox/dist >/Users/pawelad/Temp/test space/.tox/log/tox-0.log

My guess is that the first item, /Users/pawelad/Temp/test space$ and the trailing dollar sign is the reason, but with that I kinda reached a dead end.

Fun, fun, fun : -)

@obestwalter
Copy link
Member

That's why I keep telling people that spaces in filenames are evil, but they ain't listenin' :)

Good start though - would be interesting to squeeze out a bit more info out by getting the types or trying to encode the args.

@obestwalter
Copy link
Member

ups just saw that you are printing the types already.

@pawelad
Copy link

pawelad commented Mar 18, 2017

Yeah, I tried all combinations of:

for a in args:
    print(a)
    print(str(a))
    print(a.decode("utf-8"))
    print(repr(a))
    print(type(a))

Same thing all the time.

@obestwalter
Copy link
Member

huh - that is actually a bit surreal then ...

@pawelad
Copy link

pawelad commented Mar 18, 2017

Yup, never seen anything like that : -)

@obestwalter obestwalter changed the title White space in the path are reason an error in the "tox". White space in path causes tox to fail with "No such file or directory" Apr 20, 2017
@obestwalter
Copy link
Member

obestwalter commented Apr 20, 2017

Looks like the actual problem is identifed here and there 😢

@obestwalter
Copy link
Member

Even if we can't solve the actual problem (yet), we can crash early with a helpful message, clearly saying that tox does not work with spaces in paths. What do you think?

@The-Compiler
Copy link
Member

Sounds sensible - though virtualenv should probably do that (or it should do so too)

@obestwalter obestwalter added bug:upstream something does not behave as it should, but can't or shouldn't be fixed in tox, but in a dependency and removed bug labels Jul 16, 2017
@igor-sadchenko
Copy link

Please, keep in mind that the exception FileNotFoundError(tox/session.py:line 452 ) added in python 3.3 and doesn't applicable to python 2.7

@obestwalter
Copy link
Member

Thanks @igor-sadchenko - I opened #582 to fix this.

@obestwalter
Copy link
Member

Will likely be fixed with pip 10: pypa/pip#923

@obestwalter
Copy link
Member

Small consolation: @vlaci made sure users know what's going on, when it happens (released with 2.8): #556

@gauravv7
Copy link

This error has also occured for me too with tox scripts running locally. Turns out that a virtualenv is created with tox which has an absolute path with length about 96 characters but whenever it takes your absolute 'bin/pip' path to near about 123 chars, there is an invocation error, OSError2.

'ERROR: invocation failed (errno 2),
OSError: [Errno 2] No such file or directory'

Python: Python 2.7.6
virtualenv:15.1.0
tox: 2.9.1
pip: 9.0.1
ubuntu 14.04
test ran with coverage: django(1.8-1.11) tests with py27, py35 each

Resolution:
I created my virtualenv(with abs path <=(96-100) chars) first where tox is installed, cloned my project to be used with this tox installation and virtualenv, tox creates it own virtualenvs now and it runs fine.

hope it helps.

@ssteinerx
Copy link

@gauravv7 Python 2.7.6 was released on November 10, 2013 and the other tools are also way out of date. The actual issue could be anywhere.

@gauravv7
Copy link

@ssteinerx I understand that, but there is no related documentation from travis for such a requirement. I already tried relating envs via matrix and updating the image too manually. I confirmed this by pulling the travis image locally and checking the python interpreters.
Travis simply fails here.

@asottile
Copy link
Contributor

I'm seeing this as fixed:

(venv) asottile@asottile-VirtualBox:/tmp/t/with spaces$ which tox
/tmp/t/with spaces/venv/bin/tox
(venv) asottile@asottile-VirtualBox:/tmp/t/with spaces$ pwd
/tmp/t/with spaces
(venv) asottile@asottile-VirtualBox:/tmp/t/with spaces$ tox -e py27 | tail -2
  py27: commands succeeded
  congratulations :)

Upgrade virtualenv (installed alongside tox) to a version that updates pip automatically (>=14) or if you have VIRTUALENV_NO_DOWNLOAD=1 then >=16.

pip has fixed the upstream issue

(I verified the broken state by downgrading virtualenv + installing tox-virtualenv-no-download)

Successfully installed virtualenv-15.2.0
GLOB sdist-make: /tmp/t/with spaces/setup.py
py27 create: /tmp/t/with spaces/.tox/py27
py27 installdeps: -rrequirements-dev.txt
ERROR: invocation failed (errno 2), args: ['/tmp/t/with spaces/.tox/py27/bin/pip', 'install', '-rrequirements-dev.txt'], cwd: /tmp/t/with spaces
Traceback (most recent call last):
  File "/tmp/t/with spaces/venv/bin/tox", line 12, in <module>
    sys.exit(run_main())
  File "/tmp/t/with spaces/venv/local/lib/python2.7/site-packages/tox/session.py", line 40, in run_main
    main(args)
  File "/tmp/t/with spaces/venv/local/lib/python2.7/site-packages/tox/session.py", line 46, in main
    retcode = Session(config).runcommand()
  File "/tmp/t/with spaces/venv/local/lib/python2.7/site-packages/tox/session.py", line 415, in runcommand
    return self.subcommand_test()
  File "/tmp/t/with spaces/venv/local/lib/python2.7/site-packages/tox/session.py", line 599, in subcommand_test
    if self.setupenv(venv):
  File "/tmp/t/with spaces/venv/local/lib/python2.7/site-packages/tox/session.py", line 491, in setupenv
    status = venv.update(action=action)
  File "/tmp/t/with spaces/venv/local/lib/python2.7/site-packages/tox/venv.py", line 171, in update
    self.hook.tox_testenv_install_deps(action=action, venv=self)
  File "/tmp/t/with spaces/venv/local/lib/python2.7/site-packages/pluggy.py", line 724, in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
  File "/tmp/t/with spaces/venv/local/lib/python2.7/site-packages/pluggy.py", line 338, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/tmp/t/with spaces/venv/local/lib/python2.7/site-packages/pluggy.py", line 333, in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
  File "/tmp/t/with spaces/venv/local/lib/python2.7/site-packages/pluggy.py", line 596, in execute
    res = hook_impl.function(*args)
  File "/tmp/t/with spaces/venv/local/lib/python2.7/site-packages/tox/venv.py", line 452, in tox_testenv_install_deps
    venv._install(deps, action=action)
  File "/tmp/t/with spaces/venv/local/lib/python2.7/site-packages/tox/venv.py", line 331, in _install
    action=action)
  File "/tmp/t/with spaces/venv/local/lib/python2.7/site-packages/tox/venv.py", line 303, in run_install_command
    action=action, redirect=self.session.report.verbosity < 2)
  File "/tmp/t/with spaces/venv/local/lib/python2.7/site-packages/tox/venv.py", line 409, in _pcall
    redirect=redirect, ignore_ret=ignore_ret)
  File "/tmp/t/with spaces/venv/local/lib/python2.7/site-packages/tox/session.py", line 150, in popen
    stdout=stdout, stderr=subprocess.STDOUT)
  File "/tmp/t/with spaces/venv/local/lib/python2.7/site-packages/tox/session.py", line 243, in _popen
    stdout=stdout, stderr=stderr, env=env)
  File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

@obestwalter
Copy link
Member

That's great news! 🎆

@eirnym
Copy link

eirnym commented Jul 24, 2018

This still doesn't work with tox version 3.1.2

Thetox -vvv output is following:

using tox.ini: /some/path/with space/core/tox.ini
using tox-3.1.2 from /Users/eirnym/Development/sdk/python/36/ens/lib/python3.6/site-packages/tox/__init__.py
GLOB start: packaging 
GLOB sdist-make: /some/path/with space/core/setup.py
  /some/path/with space/core$ /Users/eirnym/Development/sdk/python/36/ens/bin/python /some/path/with space/core/setup.py sdist --formats=zip --dist-dir /some/path/with space/core/.tox/dist >/some/path/with space/core/.tox/log/tox-0.log
GLOB finish: packaging after 1.02 seconds
copying new sdistfile to '/Users/eirnym/.tox/distshare/mypackage-0.2.dev1.zip'
py36 start: getenv /some/path/with space/core/.tox/py36
py36 create: /some/path/with space/core/.tox/py36
setting PATH=/some/path/with space/core/.tox/py36/bin:/Users/eirnym/Development/sdk/python/36/ens/bin:/Users/eirnym/.zplug/bin:/Users/eirnym/bin:/Users/eirnym/bin/local:/Users/eirnym/bin/mac:/Users/eirnym/bin/vcs:/opt/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/eirnym/.rvm/bin:/Users/eirnym/.zplug/repos/unixorn/git-extra-commands/bin
  /some/path/with space/core/.tox$ /Users/eirnym/Development/sdk/python/36/ens/bin/python -m virtualenv --python /opt/local/bin/python3.6 py36 >/some/path/with space/core/.tox/py36/log/py36-0.log
py36 finish: getenv after 8.76 seconds
py36 start: installpkg /some/path/with space/core/.tox/dist/mypackage-0.2.dev1.zip
py36 inst: /some/path/with space/core/.tox/dist/mypackage-0.2.dev1.zip
setting PATH=/some/path/with space/core/.tox/py36/bin:/Users/eirnym/Development/sdk/python/36/ens/bin:/Users/eirnym/.zplug/bin:/Users/eirnym/bin:/Users/eirnym/bin/local:/Users/eirnym/bin/mac:/Users/eirnym/bin/vcs:/opt/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/eirnym/.rvm/bin:/Users/eirnym/.zplug/repos/unixorn/git-extra-commands/bin
  /some/path/with space/core$ /some/path/with space/core/.tox/py36/bin/pip install /some/path/with space/core/.tox/dist/mypackage-0.2.dev1.zip[testing] 
Processing ./.tox/dist/mypackage-0.2.dev1.zip
[...]
Building wheels for collected packages: mypackage
  Running setup.py bdist_wheel for mypackage ... done
  Stored in directory: /Users/eirnym/Library/Caches/pip/wheels/44/1c/9a/874b058b2608a4e078cfb11e339114d93933f843fdcc507a00
Successfully built mypackage
Installing collected packages: idna, multidict, yarl, attrs, async-timeout, idna-ssl, chardet, aiohttp, aiohttp-session, asyncpg, ujson, asynctest, coverage, pyflakes, pycodestyle, mccabe, flake8, py, six, atomicwrites, more-itertools, pluggy, pytest, pytest-asyncio, pytest-cov, pytest-flake8, pytest-metadata, pytest-html, click, typed-ast, retype, MonkeyType, pytest-monkeytype, virtualenv, pyparsing, packaging, tox, mypackage
Successfully installed MonkeyType-18.5.1 aiohttp-3.3.2 aiohttp-session-2.5.1 async-timeout-3.0.0 asyncpg-0.17.0 asynctest-0.12.2 atomicwrites-1.1.5 attrs-18.1.0 chardet-3.0.4 click-6.7 coverage-4.5.1 flake8-3.5.0 idna-2.7 idna-ssl-1.1.0 mccabe-0.6.1 more-itertools-4.2.0 multidict-4.3.1 packaging-17.1 pluggy-0.6.0 py-1.5.4 pycodestyle-2.3.1 pyflakes-1.6.0 pyparsing-2.2.0 pytest-3.6.3 pytest-asyncio-0.8.0 pytest-cov-2.5.1 pytest-flake8-1.0.1 pytest-html-1.19.0 pytest-metadata-1.7.0 pytest-monkeytype-1.0.1 retype-17.12.0 six-1.11.0 mypackage-0.2.dev1 tox-3.1.2 typed-ast-1.1.0 ujson-1.35 virtualenv-16.0.0 yarl-1.2.6
py36 finish: installpkg after 20.06 seconds
py36 start: envreport 
setting PATH=/some/path/with space/core/.tox/py36/bin:/Users/eirnym/Development/sdk/python/36/ens/bin:/Users/eirnym/.zplug/bin:/Users/eirnym/bin:/Users/eirnym/bin/local:/Users/eirnym/bin/mac:/Users/eirnym/bin/vcs:/opt/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/eirnym/.rvm/bin:/Users/eirnym/.zplug/repos/unixorn/git-extra-commands/bin
  /some/path/with space/core$ /some/path/with space/core/.tox/py36/bin/pip freeze >/some/path/with space/core/.tox/py36/log/py36-1.log
py36 finish: envreport after 1.48 seconds
py36 installed: aiohttp==3.3.2,aiohttp-session==2.5.1,async-timeout==3.0.0,asyncpg==0.17.0,asynctest==0.12.2,atomicwrites==1.1.5,attrs==18.1.0,chardet==3.0.4,click==6.7,coverage==4.5.1,flake8==3.5.0,idna==2.7,idna-ssl==1.1.0,mccabe==0.6.1,MonkeyType==18.5.1,more-itertools==4.2.0,multidict==4.3.1,packaging==17.1,pluggy==0.6.0,py==1.5.4,pycodestyle==2.3.1,pyflakes==1.6.0,pyparsing==2.2.0,pytest==3.6.3,pytest-asyncio==0.8.0,pytest-cov==2.5.1,pytest-flake8==1.0.1,pytest-html==1.19.0,pytest-metadata==1.7.0,pytest-monkeytype==1.0.1,retype==17.12.0,six==1.11.0,mypackage==0.2.dev1,tox==3.1.2,typed-ast==1.1.0,ujson==1.35,virtualenv==16.0.0,yarl==1.2.6
py36 start: runtests 
py36 runtests: PYTHONHASHSEED='2031400764'
py36 runtests: commands[0] | coverage erase
setting PATH=/some/path/with space/core/.tox/py36/bin:/Users/eirnym/Development/sdk/python/36/ens/bin:/Users/eirnym/bin:/opt/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
  /some/path/with space/core$ /some/path/with space/core/.tox/py36/bin/coverage erase 
py36 runtests: commands[1] | pytest -v --flake8 --cache-clear --cov /some/path/with space/core/.tox/py36/lib/python3.6/site-packages/mypackage --cov-report=html --cov-report=term --html=report.html --monkeytype-output=monkeytype.sqlite3
setting PATH=/some/path/with space/core/.tox/py36/bin:/Users/eirnym/Development/sdk/python/36/ens/bin:/Users/eirnym/bin:/opt/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
  /some/path/with space/core$ /some/path/with space/core/.tox/py36/bin/pytest -v --flake8 --cache-clear --cov /some/path/with space/core/.tox/py36/lib/python3.6/site-packages/mypackage --cov-report=html --cov-report=term --html=report.html --monkeytype-output=monkeytype.sqlite3 
============================================================================== test session starts ===============================================================================
platform darwin -- Python 3.6.6, pytest-3.6.3, py-1.5.4, pluggy-0.6.0 -- /some/path/with space/core/.tox/py36/bin/python3.6
cachedir: .pytest_cache
metadata: {'Python': '3.6.6', 'Platform': 'Darwin-16.7.0-x86_64-i386-64bit', 'Packages': {'pytest': '3.6.3', 'py': '1.5.4', 'pluggy': '0.6.0'}, 'Plugins': {'monkeytype': '1.0.1', 'metadata': '1.7.0', 'html': '1.19.0', 'flake8': '1.0.1', 'cov': '2.5.1', 'asyncio': '0.8.0'}}
rootdir: /some/path/with space/core, inifile: tox.ini
plugins: monkeytype-1.0.1, metadata-1.7.0, html-1.19.0, flake8-1.0.1, cov-2.5.1, asyncio-0.8.0

-------------------------------------------- generated html file: /some/path/with space/core/report.html ---------------------------------------------
========================================================================== no tests ran in 0.05 seconds ==========================================================================
ERROR: file not found: network/core/.tox/py36/lib/python3.6/site-packages/mypackage

ERROR: InvocationError for command '/some/path/with space/core/.tox/py36/bin/pytest -v --flake8 --cache-clear --cov /some/path/with space/core/.tox/py36/lib/python3.6/site-packages/mypackage --cov-report=html --cov-report=term --html=report.html --monkeytype-output=monkeytype.sqlite3' (exited with code 4)
py36 finish: runtests after 2.21 seconds
____________________________________________________________________________________ summary _____________________________________________________________________________________
ERROR:   py36: commands failed

@asottile
Copy link
Contributor

@eirnym that appears to be a separate issue -- paste your configuration?

@asottile
Copy link
Contributor

@eirnym actually, there might a separate issue here -- I'll open a new issue for that -- thanks!

[tox]
skipsdist = true

[testenv]
commands =
    python -c 'import sys; print(sys.argv[1:])' -- {toxinidir}

In /private/tmp/t t:

$ tox -e py37 -qq
['--', '/private/tmp/t', 't']

Expected:

$ tox -e py37 -qq
['--', '/private/tmp/t t']

If I quote {toxinidir} it works though:

[tox]
skipsdist = true

[testenv]
commands =
    python -c 'import sys; print(sys.argv[1:])' -- '{toxinidir}'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug:upstream something does not behave as it should, but can't or shouldn't be fixed in tox, but in a dependency
Projects
None yet
Development

No branches or pull requests

9 participants