This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author orsenthil
Recipients asvetlov, georg.brandl, orsenthil, sandro.tosi
Date 2013-02-26.08:42:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1361868138.57.0.105780464579.issue16932@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2013-02-26 08:42:18orsenthilsetrecipients: + orsenthil, georg.brandl, asvetlov, sandro.tosi
2013-02-26 08:42:18orsenthilsetmessageid: <1361868138.57.0.105780464579.issue16932@psf.upfronthosting.co.za>
2013-02-26 08:42:18orsenthillinkissue16932 messages
2013-02-26 08:42:18orsenthilcreate