-
-
Notifications
You must be signed in to change notification settings - Fork 523
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
Comments
Original comment by olintsmith This is essentially the same issue as #66; it is fixed by pull request #172. |
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 |
Just ran into this on another project. I thought this had been solved in a general way like 10 years ago... |
@ssteinerx can confirm:
|
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:
My guess would be that the above is the reason because we're using 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:
So, it correctly printed the first time:
but it crashed on the second one with the bizarro Via
My guess is that the first item, Fun, fun, fun : -) |
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. |
ups just saw that you are printing the types already. |
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. |
huh - that is actually a bit surreal then ... |
Yup, never seen anything like that : -) |
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? |
Sounds sensible - though virtualenv should probably do that (or it should do so too) |
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 |
Thanks @igor-sadchenko - I opened #582 to fix this. |
Will likely be fixed with pip 10: pypa/pip#923 |
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), Python: Python 2.7.6 Resolution: hope it helps. |
@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. |
@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. |
I'm seeing this as fixed:
Upgrade pip has fixed the upstream issue (I verified the broken state by downgrading virtualenv + installing
|
That's great news! 🎆 |
This still doesn't work with The
|
@eirnym that appears to be a separate issue -- paste your configuration? |
@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
Expected:
If I quote [tox]
skipsdist = true
[testenv]
commands =
python -c 'import sys; print(sys.argv[1:])' -- '{toxinidir}' |
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.
The text was updated successfully, but these errors were encountered: