[issue27089] I think this is a small bug in urlparse.py

2016-05-23 Thread Berker Peksag
Berker Peksag added the comment: > 4. Personally, Given a wrong formated url, It is the responsibility of the > module to correct it ? It's not the responsibility of the library to correct (or make a guess on) user input. -- nosy: +berker.peksag resolution: -> not a bug stage: -> re

[issue27089] I think this is a small bug in urlparse.py

2016-05-23 Thread Antti Haapala
Antti Haapala added the comment: This behaviour exists exactly because the return value also contains the `.hostname`, which for the IPv6 addresses is *without* brackets: >>> urlparse('http://[::1]:80/').hostname '::1' There is no way to get a proper parsing result from such a broken U

[issue27089] I think this is a small bug in urlparse.py

2016-05-23 Thread Xiang Zhang
Xiang Zhang added the comment: Ohh, not objective, but subjective. Sorry. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue27089] I think this is a small bug in urlparse.py

2016-05-23 Thread Xiang Zhang
Xiang Zhang added the comment: As a general purpose library for url parsing, I think conforming to the existing standard is a good choice. 'http://google.com]' is a malformed URI according to the standard and then I think raising an exception is quite suitable. Of course there are always malf

[issue27089] I think this is a small bug in urlparse.py

2016-05-23 Thread Feng A
Feng A added the comment: I wish you could think twice if you hadn't use urlparse.py in practical project. 1. Do you like the module to raise an exception? 2. The href in webpage is always standard format? 3. Should the parse module verify the ipv6 url format? If so, did the module really ma

[issue27089] I think this is a small bug in urlparse.py

2016-05-23 Thread Xiang Zhang
Xiang Zhang added the comment: Why? I think this is the right behaviour. According to the rfc[1], square brackets are used and only used to refer IPv6 address in URI. Square brackets are reserved characters and the URI you give is not correct. 1. http://tools.ietf.org/html/rfc3986#section-3 -

[issue27089] I think this is a small bug in urlparse.py

2016-05-23 Thread Feng A
New submission from Feng A: = BUG: run : urlparse.urlparse('http://google.com]') then: raise ValueError("Invalid IPv6 URL") = SOURCE: if url[:2] == '//': netloc, url = _splitnet