pip 19.2 install raises "Failed to parse" if username contains '@'

Created on 23 Jul 2019  路  2Comments  路  Source: pypa/pip

Environment

  • pip version: 19.2
  • Python version: 3.7.4
  • OS: RHEL

Description

It seems like pip 19.2 cannot handle the case of having an email as username in index-url:

$ pip install test
Looking in indexes: https://user_at_example.com:****@url-to-pypi-server
Collecting test
...

But using [email protected] I get:

pip install test
Looking in indexes: https://user%40example.com:****@url-to-pypi-server
Collecting test
ERROR: Could not install packages due to an EnvironmentError: Failed to parse: https://[email protected]:pass@url-to-pypi-server

Expected behavior

User names with symbols like @ should be supported too. It works for 19.1.1.

How to Reproduce

Just use @ as part of the user name.

Output

Provided in the examples above.

duplicate auto-locked

Most helpful comment

A possible workaround is to urlencode the @ in the username with %40.

All 2 comments

A possible workaround is to urlencode the @ in the username with %40.

Closing this in favor of #6775. AFAICT, they're the same underlying issue.

Was this page helpful?
0 / 5 - 0 ratings