comparison mercurial/url.py @ 9108:eef406165507

url: fix use of non-int port in https connections (issue1725) Versions of Python before 2.6 cannot automatically convert a given port number to an integer, so we add a conversion to coerce the given input to an int.
author Henrik Stuart <hg@hstuart.dk>
date Wed, 08 Jul 2009 18:35:13 +0200
parents 89b71acdac9a
children a9eae2f3241c
comparison
equal deleted inserted replaced
9101:71d26ae62fbb 9108:eef406165507
439 certfile = self.auth['cert'] 439 certfile = self.auth['cert']
440 440
441 # let host port take precedence 441 # let host port take precedence
442 if ':' in host and '[' not in host or ']:' in host: 442 if ':' in host and '[' not in host or ']:' in host:
443 host, port = host.rsplit(':', 1) 443 host, port = host.rsplit(':', 1)
444 port = int(port)
444 if '[' in host: 445 if '[' in host:
445 host = host[1:-1] 446 host = host[1:-1]
446 447
447 return httpsconnection(host, port, keyfile, certfile, *args, **kwargs) 448 return httpsconnection(host, port, keyfile, certfile, *args, **kwargs)
448 449