Author cfs-pure
Recipients cfs-pure, martin.panter
Date 2016-10-26.22:03:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I misapplied the term 'regression'.  My intent was to describe how original author's change revision 433606e9546c was refactored to make it perform incorrectly.

Without the scope specifier, the outcome is the same when HTTPConnection is instantiated.  When both the host and port arguments are specified, the square brackets are not stripped and are stored in the host attribute.  When the port number is part of the host argument and the port argument is None, the host attribute does not include the square brackets.  Examples:

Python 2.7.10 (default, Jul 30 2016, 18:31:42) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import httplib
>>> con1 = httplib.HTTPConnection('[fe80::26a9:37ff:fe00:f764]', 15482)
>>>, con1.port
('[fe80::26a9:37ff:fe00:f764]', 15482)
>>> con2 = httplib.HTTPConnection('[fe80::26a9:37ff:fe00:f764]:15482')
>>>, con2.port
('fe80::26a9:37ff:fe00:f764', 15482)

Compare with IPv4 behavior:

>>> con3 = httplib.HTTPConnection('', 15482)
>>>, con3.port
('', 15482)
>>> con4 = httplib.HTTPConnection('')
>>>, con4.port
('', 15482)

Calls to con1.request() will fail in because getaddrinfo will choke on the square brackets.  Which makes sense since is passed on down the stack as-is until it reaches create_connection() in

Moving the indent of that if block up one level makes con1 identical to con2.
Date User Action Args
2016-10-26 22:03:58cfs-puresetrecipients: + cfs-pure, martin.panter
2016-10-26 22:03:58cfs-puresetmessageid: <>
2016-10-26 22:03:58cfs-purelinkissue28539 messages
2016-10-26 22:03:57cfs-purecreate