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 fails if path to project dir contains non-ASCII characters #291

Closed
pytoxbot opened this issue Sep 17, 2016 · 5 comments
Closed

tox fails if path to project dir contains non-ASCII characters #291

pytoxbot opened this issue Sep 17, 2016 · 5 comments
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

To test, I create a trivial setup.py

import setuptools
setuptools.setup()

… and an equally trivial tox.ini:

[tox]
envlist = py34

Running tox produces the following error:

michi ~/ä$ tox
GLOB sdist-make: /Users/michi/ä/setup.py
py34 create: /Users/michi/ä/.tox/py34
ERROR: invocation failed (exit code 1), logfile: /Users/michi/ä/.tox/py34/log/py34-0.log
ERROR: actionid: py34
msg: getenv
cmdargs: ['/opt/local/Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4', '-m', 'virtualenv', '--python', '/opt/local/bin/python3.4', 'py34']
env: {'VIRTUAL_ENV': '/Users/michi/ä/.tox/py34', 'PATH': '/Users/michi/ä/.tox/py34/bin:/Users/michi/opt/bin/native/Darwin:/Users/michi/opt/bin:/opt/local/bin:/opt/local/sbin:/opt/local/libexec/gnubin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/MacGPG2/bin:/usr/local/bin', 'TMPDIR': '/var/folders/dy/tjw4y9qj127crhw6pzmcl_lh0000gq/T/', 'PYTHONHASHSEED': '274154285'}

Using base prefix '/opt/local/Library/Frameworks/Python.framework/Versions/3.4'
New python executable in py34/bin/python3.4
Also creating executable in py34/bin/python
Installing setuptools, pip, wheel...
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/virtualenv.py", line 2363, in <module>
    main()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/virtualenv.py", line 832, in main
    symlink=options.symlink)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/virtualenv.py", line 1004, in create_environment
    install_wheel(to_install, py_executable, search_dirs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/virtualenv.py", line 969, in install_wheel
    'PIP_NO_INDEX': '1'
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/virtualenv.py", line 906, in call_subprocess
    logger.notify('Complete output from command %s:' % cmd_desc)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/virtualenv.py", line 328, in notify
    self.log(self.NOTIFY, msg, *args, **kw)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/virtualenv.py", line 356, in log
    consumer.write(rendered+'\n')
UnicodeEncodeError: 'ascii' codec can't encode character '\xe4' in position 44: ordinal not in range(128)
Running virtualenv with interpreter /opt/local/bin/python3.4

ERROR: InvocationError: /opt/local/Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4 -m virtualenv --python /opt/local/bin/python3.4 py34 (see /Users/michi/ä/.tox/py34/log/py34-0.log)
___________________________________ summary ____________________________________
ERROR:   py34: InvocationError: /opt/local/Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4 -m virtualenv --python /opt/local/bin/python3.4 py34 (see /Users/michi/ä/.tox/py34/log/py34-0.log)
michi ~/ä$ 

Moving the project directory so its path only contains ASCII characters resolves the problem. This happens with tox 2.0.1 on OS X 10.9.5.

@obestwalter obestwalter added the bug label Nov 4, 2016
@obestwalter
Copy link
Member

obestwalter commented Nov 4, 2016

@Feuermurmel - thanks for the report. Would you consider attempting a fix and a PR yourself?

EDIT - just saw that this issue is quite old. Maybe you could try reproducing it first - might as well be fixed already.

@obestwalter
Copy link
Member

This might be tackled together with #121 and #203

@pawelad
Copy link

pawelad commented Mar 18, 2017

I couldn't replicate this (same file content):

$ pwd
/Users/pawelad/Temp/łćóąęä

$ cat setup.py
import setuptools
setuptools.setup()

$ cat tox.ini
[tox]
envlist = py34

$ tox
GLOB sdist-make: /Users/pawelad/Temp/łćóąęä/setup.py
py34 create: /Users/pawelad/Temp/łćóąęä/.tox/py34
py34 inst: /Users/pawelad/Temp/łćóąęä/.tox/dist/UNKNOWN-0.0.0.zip
py34 installed: appdirs==1.4.3,packaging==16.8,pyparsing==2.2.0,six==1.10.0,UNKNOWN==0.0.0
ERROR: Commands not specified. Please update relevant section of /Users/pawelad/Temp/łćóąęä/tox.ini
_______________________________________________________ summary ________________________________________________________
ERROR:   py34: nothing to do

Also, correct me if I'm wrong but looking at the stacetrack it seems like the issue was in virtualenv package, not in tox itself.

@Feuermurmel
Copy link

@pawelad I get the same result on OS X 10.11.6. My original issue seems to be resolved:

michi ~$ mkdir ä
michi ~$ cd ä
michi ~/ä$ cat > setup.py
import setuptools
setuptools.setup()
michi ~/ä$ cat > tox.ini
[tox]
envlist = py34
michi ~/ä$ tox
GLOB sdist-make: /Users/michi/ä/setup.py
py34 create: /Users/michi/ä/.tox/py34
py34 inst: /Users/michi/ä/.tox/dist/UNKNOWN-0.0.0.zip
py34 installed: appdirs==1.4.3,packaging==16.8,pyparsing==2.2.0,six==1.10.0,UNKNOWN==0.0.0
py34 runtests: PYTHONHASHSEED='4118258867'
___________________________________ summary ____________________________________
  py34: commands succeeded
  congratulations :)

@RonnyPfannschmidt
Copy link

this is a virtualenv issue and seems to be fixed

@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
@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: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

5 participants