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 2008年04月07日 08:37 by pk, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Messages (4) | |||
|---|---|---|---|
| msg65071 - (view) | Author: (pk) | Date: 2008年04月07日 08:37 | |
Hello,
the urlparse() function accepts a parameter default_scheme, to be used
if the address given does not contain one, but I cannot make
use of it, because I would expect these two returning
identical values:
>>> from urlparse import urlparse
>>> urlparse("www","http")
('http', '', 'www', '', '', '')
>>> urlparse("http://www","http")
('http', 'www', '', '', '', '')
This has been reported about six years ago but apparently
the behaviour hasn't changed. I cannot imagine that this
really is the intended behaviour.
Regards,
pk
|
|||
| msg65072 - (view) | Author: (pk) | Date: 2008年04月07日 08:45 | |
and this is the url to the old report: http://mail.python.org/pipermail/python-list/2002-August/157171.html |
|||
| msg68520 - (view) | Author: Anthony Lenton (elachuni) * | Date: 2008年06月21日 17:31 | |
In http://bugs.python.org/issue754016 there's already a discussion about this. The RFC that urlparse is following (rfc 1808) requires the net_loc component to start with // even if the scheme component is missing, which is why urlparse("www","http") puts the 'www' in to the path component instead of net_loc. It seems that this is indeed the intended behavior, and the patch for issue 754016 adds a docfix clarifying this. |
|||
| msg68522 - (view) | Author: Facundo Batista (facundobatista) * (Python committer) | Date: 2008年06月21日 17:38 | |
Thanks (pk) and Anthony! |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:33 | admin | set | github: 46821 |
| 2008年06月21日 17:38:08 | facundobatista | set | status: open -> closed resolution: duplicate messages: + msg68522 |
| 2008年06月21日 17:35:54 | elachuni | set | nosy: + facundobatista |
| 2008年06月21日 17:31:17 | elachuni | set | nosy:
+ elachuni messages: + msg68520 |
| 2008年04月07日 08:45:10 | pk | set | messages: + msg65072 |
| 2008年04月07日 08:37:55 | pk | create | |