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 crashes on non-ASCII symbol in lsb_release output #4062

Closed
iavael opened this Issue Nov 3, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@iavael

iavael commented Nov 3, 2016

  • Pip version: 9.0.0
  • Python version: CPython 3.5.2
  • Operating System: Fedora release 19 (Schrödinger’s Cat)

Description:

According to

stdout, stderr = stdout.decode('ascii'), stderr.decode('ascii')
pip wants lsb_release -a output to be strictly in ascii only, while there can be any unicode symbol. Because of that it crashes on Fedora release 19 (Schrödinger’s Cat) with traceback

Traceback (most recent call last):
  File "/home/username/.virtualenvs/powerdns-cpython3.5/bin/pip", line 11, in <module>
    sys.exit(main())
  File "/home/username/.virtualenvs/powerdns-cpython3.5/lib/python3.5/site-packages/pip/__init__.py", line 233, in main
    return command.main(cmd_args)
  File "/home/username/.virtualenvs/powerdns-cpython3.5/lib/python3.5/site-packages/pip/basecommand.py", line 251, in main
    timeout=min(5, options.timeout)) as session:
  File "/home/username/.virtualenvs/powerdns-cpython3.5/lib/python3.5/site-packages/pip/basecommand.py", line 72, in _build_session
    insecure_hosts=options.trusted_hosts,
  File "/home/username/.virtualenvs/powerdns-cpython3.5/lib/python3.5/site-packages/pip/download.py", line 329, in __init__
    self.headers["User-Agent"] = user_agent()
  File "/home/username/.virtualenvs/powerdns-cpython3.5/lib/python3.5/site-packages/pip/download.py", line 93, in user_agent
    from pip._vendor import distro
  File "/home/username/.virtualenvs/powerdns-cpython3.5/lib/python3.5/site-packages/pip/_vendor/distro.py", line 1051, in <module>
    _distro = LinuxDistribution()
  File "/home/username/.virtualenvs/powerdns-cpython3.5/lib/python3.5/site-packages/pip/_vendor/distro.py", line 594, in __init__
    if include_lsb else {}
  File "/home/username/.virtualenvs/powerdns-cpython3.5/lib/python3.5/site-packages/pip/_vendor/distro.py", line 922, in _lsb_release_info
    stdout, stderr = stdout.decode('ascii'), stderr.decode('ascii')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 250: ordinal not in range(128)

What I've run:

pip install .
@iavael

This comment has been minimized.

Show comment
Hide comment
@iavael

iavael Nov 3, 2016

Fixed in distro module in nir0s/distro#144

iavael commented Nov 3, 2016

Fixed in distro module in nir0s/distro#144

@dstufft dstufft added this to the 9.0.1 milestone Nov 3, 2016

@dstufft

This comment has been minimized.

Show comment
Hide comment
@dstufft

dstufft Nov 3, 2016

Member

If you can try out #4067 and see if that fixes it for you, that would be great.

Member

dstufft commented Nov 3, 2016

If you can try out #4067 and see if that fixes it for you, that would be great.

@dstufft dstufft closed this in #4067 Nov 3, 2016

@iavael

This comment has been minimized.

Show comment
Hide comment
@iavael

iavael Nov 3, 2016

Works fine, thanks.

iavael commented Nov 3, 2016

Works fine, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment