[PATCH] url: fix use of non-int port in https connections (issue1725)

Adrian Buehlmann adrian at cadifra.com
Wed Jul 8 12:35:57 CDT 2009


On 08.07.2009 18:36, Henrik Stuart wrote:
> # HG changeset patch
> # User Henrik Stuart <hg at hstuart.dk>
> # Date 1247070913 -7200
> # Node ID b04534d4bd70eb886efb899e6ef8b2b5b64d7170
> # Parent  196d40e7c885fa6e95f89134809b3ec7bdbca34b
> 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.
> 
> diff -r 196d40e7c885 -r b04534d4bd70 mercurial/url.py
> --- a/mercurial/url.py	Wed Jul 01 13:57:01 2009 -0500
> +++ b/mercurial/url.py	Wed Jul 08 18:35:13 2009 +0200
> @@ -441,6 +441,7 @@
>              # let host port take precedence
>              if ':' in host and '[' not in host or ']:' in host:
>                  host, port = host.rsplit(':', 1)
> +                port = int(port)
>                  if '[' in host:
>                      host = host[1:-1]
>  
>

I can confirm this fixes the use case (from issue1725):

hg clone https://hg.assembla.com:443/luasocket luasocket

(tested on Windows XP)


More information about the Mercurial-devel mailing list