Skip to content

URL Parse Split incorreclty interpret proxy pw, which include '?'  #101186

Description

@NamUKF

Hi,

I have exported the env var for http proxy, where the Username and password is included in the URL.
The password of the user includes an '?', which is the reason, why the URL string is not correctly processed.

The URL
http_proxy='http://<username>:<pass_with_?>@<server>:<port>'

When the method splits:

if '?' in url:

It splits at the ? of the password.

Therefore resulting into

 File "/usr/lib/python3/dist-packages/httplib2/__init__.py", line 950, in proxy_info_from_url
    port = int(port)
ValueError: invalid literal for int() with base 10: 'p'

if the URL would be:

http://user:p?assword@server:port

Regards
Nam

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directory

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions