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.urlsplit() regression for paths consisting of digits #55676
Comments
When using a javascript URL with only digits as paths, the urlsplit() functions behaves different in Python 2.7 than in 2.6: $ python2.6 -c "import urlparse; print urlparse.urlsplit('javascript:123')"
SplitResult(scheme='javascript', netloc='', path='123', query='', fragment='')
$ python2.7 -c "import urlparse; print urlparse.urlsplit('javascript:123')"
SplitResult(scheme='', netloc='', path='javascript:123', query='', fragment='') Python 3.2 has the same regression: I consider the Python 2.6 behaviour to be correct, ie. the current behaviour is buggy. |
The behaviour change is caused by the fix for issue bpo-754016. |
What kind of url is 'javascript:123' and how do you (/ we) say that python2.6 behavior was correct? |
Regarding the correctness of the Python 2.6 implementation: http://www.faqs.org/rfcs/rfc1738.html specifies URLs of the form <scheme>:<scheme-specific-part> where the scheme specific part is allowed to consist only of digits. I agree that the example URL is not a good one and it is artificially constructed. Some better examples demonstrating the same issue might be |
To make the previous comment more precise: URLs where |
I'm attaching a patch with a fix and a unittest using the email example. I put this in a new test_RFC2368 (the mailto URL scheme) method. Seems like there is no unittest for parsing mailto scheme to begin with. |
Oops, wrong revision base. |
Santoso, Quick review comments:
|
Senthil, Thanks for the review! I was initially thinking of regrtest on Darwin-10.6.0-i386-64bit ran fine. |
New changeset 7a693e283c68 by Senthil Kumaran in branch '2.7': |
New changeset 495d12196487 by Senthil Kumaran in branch '3.1': |
Fixed this in all codelines. Thanks Santoso. |
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: