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 ztane
Recipients PaulMcMillan, benjamin.peterson, christian.heimes, martin.panter, orsenthil, pitrou, python-dev, soilandreyes, vstinner, yaaboukir, ztane
Date 2016-09-25.08:56:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1474793778.84.0.0306960822314.issue23505@psf.upfronthosting.co.za>
In-reply-to
Content
The problem is in `urlunparse`. If you check the RFC 2396, it has the following regular expression:

     ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?

where group 3 is the //netloc, and 4 is netloc substring, of an url http://netloc/foobar - and this is what Python should use to parse an URI using RFC 2396... but:

    >>> pat.fullmatch('////netloc').group(4)
    ''
    >>> pat.fullmatch('/relative').group(4)
    >>> 

Someone took the shortcut. no netloc is different from netloc being the empty string '', but 

    >>> urlparse('////netloc')
    ParseResult(scheme='', netloc='', path='//netloc', params='', query='', fragment='')
    >>> urlparse('/netloc')
    ParseResult(scheme='', netloc='', path='/netloc', params='', query='', fragment='')

In the latter parsing result netloc should be *None*. Unfortunately I believe it is too late to change this either way.
History
Date User Action Args
2016-09-25 08:56:19ztanesetrecipients: + ztane, orsenthil, pitrou, vstinner, christian.heimes, benjamin.peterson, python-dev, martin.panter, PaulMcMillan, soilandreyes, yaaboukir
2016-09-25 08:56:18ztanesetmessageid: <1474793778.84.0.0306960822314.issue23505@psf.upfronthosting.co.za>
2016-09-25 08:56:18ztanelinkissue23505 messages
2016-09-25 08:56:18ztanecreate