Senthil Kumaran added the comment:
I am noticing this one late. Sorry for that.
I agree that this is docs issue and I would like to fix it in this way.
Give the doc example as:
>>> urlparse('www.cwi.nl/%7Eguido/Python.html')
ParseResult(scheme='', netloc='', path='www.cwi.nl/%7Eguido/Python.html',
params='', query='', fragment='')
Instead of
>>> urlparse('www.cwi.nl:80/%7Eguido/Python.html')
Which introduces a trick ":80" parsing and invokes the rule that Georg pointed
out in the message. If I recollect, the point of the example was to point out
that URLs (following 1808 RFC) should start with // for their netloc to be
identified. Otherwise it is path.
A ":" on PORT without the "scheme :" is really tricky for any application, so
it is right thing for the parser to identify anything before ":" as scheme and
the implementation here is correct.
So, instead of fixing the example to identify the scheme as "www.cwi.nl" which
is quite meaningless, the better way to fix the example will be, change the
example to urlparse('www.cwi.nl/%7Eguido/Python.html') and the result remains
the same.
I am going ahead with the fix. Thanks.
----------
resolution: invalid ->
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue16932>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com