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.
Created on 2011年03月11日 13:47 by calvin, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| urlparse.patch | santoso.wijaya, 2011年03月14日 08:25 | review | ||
| Messages (12) | |||
|---|---|---|---|
| msg130570 - (view) | Author: Bastian Kleineidam (calvin) | Date: 2011年03月11日 13:47 | |
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:
$ python3.2 -c "import urllib.parse; print(urllib.parse.urlsplit('javascript:123'))"
SplitResult(scheme='', netloc='', path='javascript:123', query='', fragment='')
I consider the Python 2.6 behaviour to be correct, ie. the current behaviour is buggy.
|
|||
| msg130575 - (view) | Author: Bastian Kleineidam (calvin) | Date: 2011年03月11日 14:09 | |
The behaviour change is caused by the fix for issue #754016. |
|||
| msg130594 - (view) | Author: Senthil Kumaran (orsenthil) * (Python committer) | Date: 2011年03月11日 17:29 | |
What kind of url is 'javascript:123' and how do you (/ we) say that python2.6 behavior was correct? |
|||
| msg130599 - (view) | Author: Bastian Kleineidam (calvin) | Date: 2011年03月11日 18:41 | |
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 clsid:85bbd92o-42a0-1o69-a2e4-08002b30309d or mailto:1337@example.org |
|||
| msg130663 - (view) | Author: Bastian Kleineidam (calvin) | Date: 2011年03月12日 06:33 | |
To make the previous comment more precise: URLs where the scheme specific part begins with a digit are affected. |
|||
| msg130795 - (view) | Author: Santoso Wijaya (santoso.wijaya) * | Date: 2011年03月14日 08:23 | |
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. |
|||
| msg130796 - (view) | Author: Santoso Wijaya (santoso.wijaya) * | Date: 2011年03月14日 08:25 | |
Oops, wrong revision base. |
|||
| msg130797 - (view) | Author: Senthil Kumaran (orsenthil) * (Python committer) | Date: 2011年03月14日 08:30 | |
Santoso, Quick review comments: 1. The patch looks good. 2. I would use a temporary 'throw-away' variable instead of _, but don't bother to change it, before committing I shall take care. 3. Important - Did you find any regression with the earlier builds, also could you run the full test suite to ensure that all tests pass? |
|||
| msg130799 - (view) | Author: Santoso Wijaya (santoso.wijaya) * | Date: 2011年03月14日 09:00 | |
Senthil, Thanks for the review! I was initially thinking of `port = ...` but opted for _, arbitrarily, instead. regrtest on Darwin-10.6.0-i386-64bit ran fine. |
|||
| msg133801 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2011年04月15日 10:08 | |
New changeset 7a693e283c68 by Senthil Kumaran in branch '2.7': Issue #11467: Fix urlparse behavior when handling urls which contains scheme http://hg.python.org/cpython/rev/7a693e283c68 |
|||
| msg133802 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2011年04月15日 10:22 | |
New changeset 495d12196487 by Senthil Kumaran in branch '3.1': Issue #11467: Fix urlparse behavior when handling urls which contains scheme specific part only digits. http://hg.python.org/cpython/rev/495d12196487 |
|||
| msg133803 - (view) | Author: Senthil Kumaran (orsenthil) * (Python committer) | Date: 2011年04月15日 10:23 | |
Fixed this in all codelines. Thanks Santoso. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:14 | admin | set | github: 55676 |
| 2011年04月15日 10:23:51 | orsenthil | set | status: open -> closed resolution: fixed messages: + msg133803 stage: resolved |
| 2011年04月15日 10:22:35 | python-dev | set | messages: + msg133802 |
| 2011年04月15日 10:08:33 | python-dev | set | nosy:
+ python-dev messages: + msg133801 |
| 2011年04月14日 16:49:44 | santoso.wijaya | set | versions: + Python 3.1 |
| 2011年03月14日 09:00:51 | santoso.wijaya | set | nosy:
calvin, orsenthil, r.david.murray, santoso.wijaya messages: + msg130799 |
| 2011年03月14日 08:30:07 | orsenthil | set | nosy:
calvin, orsenthil, r.david.murray, santoso.wijaya messages: + msg130797 |
| 2011年03月14日 08:25:32 | santoso.wijaya | set | files:
+ urlparse.patch nosy: calvin, orsenthil, r.david.murray, santoso.wijaya messages: + msg130796 |
| 2011年03月14日 08:25:04 | santoso.wijaya | set | files:
- urlparse.patch nosy: calvin, orsenthil, r.david.murray, santoso.wijaya |
| 2011年03月14日 08:23:12 | santoso.wijaya | set | files:
+ urlparse.patch nosy: calvin, orsenthil, r.david.murray, santoso.wijaya messages: + msg130795 |
| 2011年03月13日 21:29:10 | santoso.wijaya | set | nosy:
+ santoso.wijaya versions: + Python 3.3 |
| 2011年03月12日 06:33:34 | calvin | set | nosy:
calvin, orsenthil, r.david.murray messages: + msg130663 |
| 2011年03月11日 18:41:29 | calvin | set | nosy:
calvin, orsenthil, r.david.murray messages: + msg130599 |
| 2011年03月11日 17:29:46 | orsenthil | set | assignee: orsenthil messages: + msg130594 keywords: + patch nosy: calvin, orsenthil, r.david.murray |
| 2011年03月11日 17:22:08 | r.david.murray | set | nosy:
+ r.david.murray, orsenthil |
| 2011年03月11日 14:09:02 | calvin | set | messages: + msg130575 |
| 2011年03月11日 13:47:52 | calvin | set | versions: + Python 3.2 |
| 2011年03月11日 13:47:41 | calvin | create | |