[Python-bugs-list] urllib.URLopener does not work with proxies (PR#67)
andrew@fc.hp.com
andrew@fc.hp.com
Thu, 26 Aug 1999 16:20:04 -0400 (EDT)
Full_Name: Andrew Patterson
Version: 1.5.1
OS:
Submission from: pintoos.fc.hp.com (15.254.49.3)
When using urllib.URLopener(proxy) (instead of setting _PROXY env variables and
calling urllib.openurl(),
you get the following error message:
File "./watchdog.py", line 118, in main
url.open(urltocheck)
File "/usr/lib/python1.5/urllib.py", line 158, in open
return getattr(self, name)(url)
File "/usr/lib/python1.5/urllib.py", line 258, in open_http
return addinfourl(fp, headers, "http:" + url)
TypeError: illegal argument type for built-in operation
When using explicti proxies, url is a tuple instead of a string. You can't
concatanate a tuple to a string, so the operation fails.