[Python-bugs-list] [Bug #114256] Python 2.0b1, Win2K - urllib failure
Sun, 24 Sep 2000 11:51:04 -0700
Bug #114256, was updated on 2000-Sep-12 09:16
Here is a current snapshot of the bug.
Bug Group: Platform-specific
Summary: Python 2.0b1, Win2K - urllib failure
Details: This might be related to bug #110692, since it seems to be related to proxies.
A program I have that works under older versions of Python now fails with this traceback:
Traceback (most recent call last):
File "IGNRatings.py", line 289, in ?
File "IGNRatings.py", line 133, in main
inStream = urllib.urlopen(url)
File "E:\Python20\lib\urllib.py", line 61, in urlopen
File "E:\Python20\lib\urllib.py", line 163, in open
return getattr(self, name)(url)
File "E:\Python20\lib\urllib.py", line 259, in open_http
h = httplib.HTTP(host)
File "E:\Python20\lib\httplib.py", line 624, in __init__
self._conn = self._connection_class(host, port)
File "E:\Python20\lib\httplib.py", line 324, in __init__
File "E:\Python20\lib\httplib.py", line 330, in _set_hostport
port = int(host[i+1:])
ValueError: invalid literal for int():
My URL is nothing special:
I have tracked the problem down a bit:
In urllib.py, line 147, the statement
proxy = self.proxies[type]
assigns the string
to "proxy". My guess is that's not right. Anyway, the following line assigns
type = 'http'
proxy = '//http://proxy:8080'
and the next line assigns
host = 'http:'
selector = '//proxy:8080'
'http:' as a host name then goes on to cause trouble when an HTTPConnection is constructed.
Hope this info helps you track it down.
Date: 2000-Sep-24 11:51
Fixed in 2.0b2.
The earlier code assumed "protocol=host;protocol=host;..." or "host", but Windows may also use "protocol=host" (just one entry), as well as "protocol://host". This code needs some more work, so I'll leave the bug open for now.
For detailed info, follow this link: