comparison mercurial/url.py @ 21543:21b3513d43e4 stable

proxy: remove unneeded _set_hostport for compatibility with Python 2.7.7rc1 With Python 2.7.7rc1, "hg pull" through HTTP CONNECT tunnel fails due to the removal of _set_hostport [1]. ... File "mercurial/url.py", line 372, in https_open return self.do_open(self._makeconnection, req) ... File "mercurial/url.py", line 342, in connect _generic_proxytunnel(self) File "mercurial/url.py", line 228, in _generic_proxytunnel self._set_hostport(self.host, self.port) AttributeError: httpsconnection instance has no attribute '_set_hostport' self._set_hostport(self.host, self.port) should be noop and can be removed because: - _set_hostport() [2] was the function to parse "host:port" string and set them to self.host and self.port, - and (self.host, self.port) pair should be valid since connect() is called prior to _generic_proxytunnel(). [1]: http://hg.python.org/cpython/rev/568041fd8090 [2]: http://hg.python.org/cpython/file/3a1db0d2747e/Lib/httplib.py#l721
author Yuya Nishihara <yuya@tcha.org>
date Thu, 22 May 2014 22:05:26 +0900
parents a939eeb94833
children bf07c19b4c82
comparison
equal deleted inserted replaced
21542:d12d8d41428e 21543:21b3513d43e4
223 223
224 def _generic_proxytunnel(self): 224 def _generic_proxytunnel(self):
225 proxyheaders = dict( 225 proxyheaders = dict(
226 [(x, self.headers[x]) for x in self.headers 226 [(x, self.headers[x]) for x in self.headers
227 if x.lower().startswith('proxy-')]) 227 if x.lower().startswith('proxy-')])
228 self._set_hostport(self.host, self.port)
229 self.send('CONNECT %s HTTP/1.0\r\n' % self.realhostport) 228 self.send('CONNECT %s HTTP/1.0\r\n' % self.realhostport)
230 for header in proxyheaders.iteritems(): 229 for header in proxyheaders.iteritems():
231 self.send('%s: %s\r\n' % header) 230 self.send('%s: %s\r\n' % header)
232 self.send('\r\n') 231 self.send('\r\n')
233 232