Alexander Belopolsky <[email protected]> added the comment:
Apparently, the failure on OSX is due to the fact that
urllib.proxy_bypass('localhost') returns True. This makes the opener to bypass
the ProxyHandler that is explicitly set up to use the correct server port:
def setUp(self):
..
proxy_url = "http://127.0.0.1:%d" % self.server.port
handler = urllib2.ProxyHandler({"http" : proxy_url})
self.proxy_digest_handler = urllib2.ProxyDigestAuthHandler()
self.opener = urllib2.build_opener(handler, self.proxy_digest_handler)
instead, the opener skips to the default HTTPHandler which attempts to connect
on port 80 with sad results.
Interestingly,
>>> urllib.proxy_bypass('127.0.0.1')
False
So the simplest fix is s/localhost/127.0.0.1/ as done in the attached patch
(issue8455.diff).
----------
keywords: +patch
nosy: +belopolsky
Added file: http://bugs.python.org/file17737/issue8455.diff
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue8455>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com