Message108330
| Author |
belopolsky |
| Recipients |
belopolsky, db3l, mark.dickinson, ned.deily, ronaldoussoren, vstinner |
| Date |
2010年06月22日.00:37:11 |
| SpamBayes Score |
0.008360399 |
| Marked as misclassified |
No |
| Message-id |
<1277167035.04.0.28245527429.issue8455@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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). |
|