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

2016-10-28 Thread Martin Panter
Martin Panter added the comment: In general, I would be against stripping square brackets if the host and port have already been separated, e.g. in the address tuple used with socket.create_connection() etc. It feels like unnecessary double processing, which should already have been done at a

[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 _

[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 ___ ___ Python-bugs-list mailing list

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

2016-10-26 Thread Zachary Ware
Zachary Ware added the comment: That looks like a bug in urllib3 to me. The host is *not* '[2620:125:9014:3240:14:240:128:0]', the host is '2620:125:9014:3240:14:240:128:0'; the brackets are merely for disambiguating the port. Compare to urllib.parse.urlsplit: >>> from urllib.parse import u

[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 Martin Panter
Martin Panter added the comment: I tried the original revision 433606e9546c code in Python 2.7 (which still allows mixed tabs and spaces), and it behaves the same as the current version. Thus I suspect revision 9e2b94a3b5dc did not change any behaviour. What is your use case? Why can’t you jus

[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 = httplib.HTTPConnection('[fe80::26a9:37ff:fe00:f764]', 15482) >

[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 instantiated. When

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

2016-10-26 Thread Martin Panter
Martin Panter added the comment: You say this is a regression. Can you point to a version that worked as you want? The IPv6 URL handling you pointed out seems to have been added to 2.4b1, and then backported to 2.3.5. I expect that earlier versions didn’t support IPv6 URLs at all. Also, it do

[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 ___

[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 ___ ___ Pytho