[issue28539] httplib/http.client HTTPConnection._set_hostport() regression

2016-10-26 Thread Charles Stephens
Charles Stephens added the comment: Yes, I'm working on patching urllib3 to preprocess the host argument to HTTPConnection. However, it makes sense to strip square brackets regardless. -- ___ Python tracker <http://bugs.python.org/is

[issue28539] httplib/http.client HTTPConnection._set_hostport() regression

2016-10-26 Thread Charles Stephens
Charles Stephens added the comment: Not when passing it to getaddrinfo(). -- ___ Python tracker <http://bugs.python.org/issue28539> ___ ___ Python-bugs-list mailin

[issue28539] httplib/http.client HTTPConnection._set_hostport() regression

2016-10-26 Thread Charles Stephens
Charles Stephens added the comment: Our internal use case is happening through requests via urllib3 for parsing. Essentially requests is taking the URL, passing it to urllib3 for parsing. urllib3 is returning a namedtuple of type Url which includes a host and port property which is being fed

[issue28539] httplib/http.client HTTPConnection._set_hostport() regression

2016-10-26 Thread Charles Stephens
Charles Stephens added the comment: Example with patch applied: Python 2.7.6 (default, Oct 26 2016, 20:33:50) [GCC 4.8.4] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import httplib >>> con1 = h

[issue28539] httplib/http.client HTTPConnection._set_hostport() regression

2016-10-26 Thread Charles Stephens
Charles Stephens added the comment: 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 inst

[issue28539] httplib/http.client HTTPConnection._set_hostport() regression

2016-10-26 Thread Charles Stephens
Changes by Charles Stephens : -- title: httplib/http.client HTTPConnection._get_hostport() regression -> httplib/http.client HTTPConnection._set_hostport() regression ___ Python tracker <http://bugs.python.org/issu

[issue28539] httplib/http.client HTTPConnection._set_hostport() regression

2016-10-26 Thread Charles Stephens
Charles Stephens added the comment: Er, that is HTTPConnection._set_hostport() not _get_hostport() -- ___ Python tracker <http://bugs.python.org/issue28

[issue28539] httplib/http.client HTTPConnection._get_hostport() regression

2016-10-26 Thread Charles Stephens
New submission from Charles Stephens: Back through the mists of time, there was a change to strip square brackets IPv6 address host literals in HTTPConnection._get_hostport(): https://hg.python.org/cpython/diff/433606e9546c/Lib/httplib.py However, the code mixed tabs and spaces and was