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

pip --log-file does not support surrogates on Python 3 #1766

Closed
mitsuhiko opened this issue Apr 27, 2014 · 1 comment
Closed

pip --log-file does not support surrogates on Python 3 #1766

mitsuhiko opened this issue Apr 27, 2014 · 1 comment
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@mitsuhiko
Copy link
Contributor

On Python 3 if you kick of a pip installation on a machine with an improperly set filesystem encoding and a non ASCII filename for the logfile, pip will fail:

$ pip --log-file=föo.log install wheel

Terminates with this:

Traceback (most recent call last):
  File "/home/mitsuhiko/.virtualenvs/flask-3.4/bin/pip", line 11, in <module>
    sys.exit(main())
  File "/home/mitsuhiko/.virtualenvs/flask-3.4/lib/python3.4/site-packages/pip/__init__.py", line 185, in main
    return command.main(cmd_args)
  File "/home/mitsuhiko/.virtualenvs/flask-3.4/lib/python3.4/site-packages/pip/basecommand.py", line 168, in main
    logger.fatal('Storing debug log for failure in %s' % log_file_fn)
  File "/home/mitsuhiko/.virtualenvs/flask-3.4/lib/python3.4/site-packages/pip/log.py", line 111, in fatal
    self.log(self.FATAL, msg, *args, **kw)
  File "/home/mitsuhiko/.virtualenvs/flask-3.4/lib/python3.4/site-packages/pip/log.py", line 162, in log
    consumer.write(write_content)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 1-2: ordinal not in range(128)
@Ivoz
Copy link
Contributor

Ivoz commented Apr 27, 2014

You know how I can get this to reproduce?

 ivo·ivosung ~/.virtualenvs » mktmpenv --python=/usr/bin/python3
Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in tmp-e39bdf52965272c/bin/python3
Also creating executable in tmp-e39bdf52965272c/bin/python
Installing setuptools, pip...done.
This is a temporary environment. It will be deleted when you run 'deactivate'.
 tmp-e39bdf52965272c ivo·ivosung ~/.virtualenvs/tmp-e39bdf52965272c » pip --log-file=föo.log install wheel
Downloading/unpacking wheel
  Downloading wheel-0.23.0-py2.py3-none-any.whl (61kB): 61kB downloaded
Installing collected packages: wheel
Successfully installed wheel
Cleaning up...

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 5, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

No branches or pull requests

2 participants