Message277350
| 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:19 | ztane | set | recipients:
+ ztane, orsenthil, pitrou, vstinner, christian.heimes, benjamin.peterson, python-dev, martin.panter, PaulMcMillan, soilandreyes, yaaboukir |
| 2016年09月25日 08:56:18 | ztane | set | messageid: <1474793778.84.0.0306960822314.issue23505@psf.upfronthosting.co.za> |
| 2016年09月25日 08:56:18 | ztane | link | issue23505 messages |
| 2016年09月25日 08:56:18 | ztane | create |
|