[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 = _splitnetloc(url, 2)

if (('[' in netloc and ']' not in netloc) or

(']' in netloc and '[' not in netloc)):

raise ValueError("Invalid IPv6 URL")

=
SOLUTION:

I THINK IT IS BETTER TO JUST REMOVE THE LAST 3 LINES ABOVE

--
components: Library (Lib)
messages: 266125
nosy: Feng A
priority: normal
severity: normal
status: open
title: I think this is a small bug in urlparse.py
type: behavior
versions: Python 2.7, Python 3.4

___
Python tracker 
<http://bugs.python.org/issue27089>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 make it?

4. Personally, Given a wrong formated url, It is the responsibility of the 
module to correct it ?

--

___
Python tracker 
<http://bugs.python.org/issue27089>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com