[issue23328] urllib2 fails for proxy credentials that contain a '/' character

Martin Panter report at bugs.python.org
Mon Feb 9 06:44:16 CET 2015


Martin Panter added the comment:

The relevant code looks like it is _parse_proxy() at Lib/urllib/request.py:693. It has custom code to search for a slash (/), so it wouldn’t be hard to make it search after the last at (@) symbol. (I previously assumed it would use urlsplit() or similar, which would be harder to adjust.)

Even Curl seems to require an @ symbol in the username or password to be encoded, i.e. the following doesn’t work, so you still need to encode the fields in general to work with Curl.

http_proxy=http://a@x:b@localhost curl . . .
http_proxy=http://a:b@x@localhost curl . . .

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23328>
_______________________________________


More information about the Python-bugs-list mailing list