New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
urlparse doesn't handle host?bla #36493
Comments
The urlparse module (at least in 2.2 and 2.1, Linux) Example:
<pre>
>>> import urlparse
>>>
urlparse.urlparse("http://www.maerkischeallgemeine.de/?loc_id=49")
('http', 'www.maerkischeallgemeine.de', '/', '',
'loc_id=49', '')
>>>
urlparse.urlparse("http://www.maerkischeallgemeine.de?loc_id=49")
('http', 'www.maerkischeallgemeine.de?loc_id=49', '',
'', '', '')
</pre> This has serious implications for urllib, since |
Logged In: YES This actually appears to be permitted by RFC2396 3.2. Authority Component Many URI schemes include a top hierarchical element for a authority = server | reg_name The authority component is preceded by a double slash |
Logged In: YES For comparison, RFC 1738 section 3.3: But even if the / may not be omitted in this case, ? is not I've just submitted a patch (712317) for this. |
Logged In: YES According to RFC2396 (ftp://ftp.isi.edu/in-notes/rfc2396.txt) |
Logged In: YES Somehow I think I'm missing something. Please check my line
So shouldn't urlparse.urlsplit('http://foo?bar=baz') return |
Logged In: YES I'm sorry, I misunderstood the patch. If it accepts such URL |
Logged In: YES This issue still exists in Python 2.3.4 and Python 2.4b2. |
Logged In: YES Fixed by applying patch bpo-712317 on maint24 and HEAD. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: