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 fails when (windows 8.1 64-bit) user directory contains unicode #1713

Closed
dholth opened this issue Apr 9, 2014 · 4 comments
Closed

pip fails when (windows 8.1 64-bit) user directory contains unicode #1713

dholth opened this issue Apr 9, 2014 · 4 comments
Labels
auto-locked Outdated issues that have been locked by automation C: encoding Related to text encoding and likely, UnicodeErrors

Comments

@dholth
Copy link
Member

dholth commented Apr 9, 2014

An irc user reported that pip fails if your Windows home directory contains an acute capital A in Python 2.7.

C:\Users\Álex\Desktop>pip

Instead, pip should be able to handle any valid path name, not just the ones that encode to ascii.

@grzn
Copy link
Contributor

grzn commented Apr 14, 2014

reproduced on OSX; I created a user with a unicode character it home directory path, and then:

Guys-MacBook-Air:~ a$ pwd
/Users/Á
Guys-MacBook-Air:~ a$ pip
Traceback (most recent call last):
  File "/usr/local/bin/pip", line 9, in <module>
    load_entry_point('pip==1.5.4', 'console_scripts', 'pip')()
  File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/__init__.py", line 177, in main
    cmd_name, cmd_args = parseopts(initial_args)
  File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/__init__.py", line 148, in parseopts
    parser.print_help()
  File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/optparse.py", line 1669, in print_help
    file.write(self.format_help().encode(encoding, "replace"))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1148: ordinal not in range(128)
Guys-MacBook-Air:~ a$ pip3
Traceback (most recent call last):
  File "/usr/local/bin/pip3", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.4/site-packages/pip/__init__.py", line 177, in main
    cmd_name, cmd_args = parseopts(initial_args)
  File "/usr/local/lib/python3.4/site-packages/pip/__init__.py", line 148, in parseopts
    parser.print_help()
  File "/usr/local/Cellar/python3/3.4.0/Frameworks/Python.framework/Versions/3.4/lib/python3.4/optparse.py", line 1646, in print_help
    file.write(self.format_help())
UnicodeEncodeError: 'ascii' codec can't encode character '\xc1' in position 1148: ordinal not in range(128)

@grzn
Copy link
Contributor

grzn commented Apr 14, 2014

needs to be labeled with bug, windows, encoding

@grzn
Copy link
Contributor

grzn commented Apr 14, 2014

The problem is with the usage of --log-file, which contains the full path of the default: /.pip/pip.log

This happens when the full path of the home directory contains unicode and encoding of the stdout stream is not unicode.

@dholth
Copy link
Member Author

dholth commented Apr 14, 2014

We should make sure these kinds of streams have permissive unicode
error handling.

On Mon, Apr 14, 2014, at 11:22 AM, Guy Rozendorn wrote:

The problem is with the usage of --log-file, which contains the full
path of the default: /.pip/pip.log

This happens when the full path of the home directory contains
unicode and encoding of the stdout stream is not unicode.

Reply to this email directly or [1]view it on GitHub.
[208018__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcxMzEwODEyMy
wiZGF0YSI6eyJpZCI6Mjk2NDczOTN9fQ==--ab0f032c3f569640afb1d6b4239e1fd4af9
880b8.gif]

References

  1. pip fails when (windows 8.1 64-bit) user directory contains unicode #1713 (comment)

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 C: encoding Related to text encoding and likely, UnicodeErrors
Projects
None yet
Development

No branches or pull requests

3 participants