[ python-Bugs-902075 ] urllib2 should be more robust for sloppy proxy URLs

SourceForge.net noreply at sourceforge.net
Sun Feb 22 05:05:18 EST 2004


Bugs item #902075, was opened at 2004-02-22 10:05
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=902075&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Matthias Klose (doko)
Assigned to: Nobody/Anonymous (nobody)
Summary: urllib2 should be more robust for sloppy proxy URLs

Initial Comment:
passing an URL like "foo.bar.baz" instead of
"http://foo.bar.baz" results in a stacktrace:

  File "/usr/lib/python2.3/urllib2.py", line 326, in open
    '_open', req)
  File "/usr/lib/python2.3/urllib2.py", line 306, in
_call_chain
    result = func(*args)
  File "/usr/lib/python2.3/urllib2.py", line 491, in
<lambda>
    lambda r, proxy=url, type=type, meth=self.proxy_open:   File "/usr/lib/python2.3/urllib2.py", line 498, in
proxy_open
    if '@' in host:
TypeError: iterable argument required

This could be fixed by calling urlparse.urlparse on the
proxy url, either in the calling code or in the library
code, which I would prefer to make it more robust about
sloppy URLs passed in the http_proxy environment variable.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=902075&group_id=5470



More information about the Python-bugs-list mailing list