[issue2987] RFC2732 support for urlparse (e.g. http://[::1]:80/)

Hans Ulrich Niedermann report at bugs.python.org
Tue May 27 22:47:34 CEST 2008


Hans Ulrich Niedermann <hun at n-dimensional.de> added the comment:

I have written this patch because urlparse could not retrieve the
hostname or port components of URIs such as
http://[::ffff:192.168.13.37]/ or http://[dead:beef::1]:8888/

This problem happens with Python 2.5.1 in Fedora 9, and I have also
found it in Python's SVN trunk/ and release25-maint/ source code.

It still needs some polishing and thinking: See the places marked
FIXME, but probably also others. One would not want an inconsistent
API feel with respect to IPv6 address handling.

Might require some more comprehensive thought about how Python wants
to handle networks other-than-IPv4, exceeding the scope of a simple
patch to urlparse.py.

On a not-totally-unrelated note, someone should examine whether IRIs[1]
can fit into urlparse.py, or whether they need e.g. a separate
iriparse.py with an adapted API.

[1] RFC 3987 - Internationalized Resource Identifiers (IRIs)
    M. Duerst, M. Suignard, January 2005

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2987>
__________________________________


More information about the Python-bugs-list mailing list