Skip to content
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

default_scheme in urlparse.urlparse() useless #46821

Closed
pk mannequin opened this issue Apr 7, 2008 · 4 comments
Closed

default_scheme in urlparse.urlparse() useless #46821

pk mannequin opened this issue Apr 7, 2008 · 4 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@pk
Copy link
Mannequin

pk mannequin commented Apr 7, 2008

BPO 2569
Nosy @facundobatista

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:

assignee = None
closed_at = <Date 2008-06-21.17:38:08.467>
created_at = <Date 2008-04-07.08:37:55.294>
labels = ['type-bug', 'library']
title = 'default_scheme in urlparse.urlparse() useless'
updated_at = <Date 2008-06-21.17:38:08.466>
user = 'https://bugs.python.org/pk'

bugs.python.org fields:

activity = <Date 2008-06-21.17:38:08.466>
actor = 'facundobatista'
assignee = 'none'
closed = True
closed_date = <Date 2008-06-21.17:38:08.467>
closer = 'facundobatista'
components = ['Library (Lib)']
creation = <Date 2008-04-07.08:37:55.294>
creator = 'pk'
dependencies = []
files = []
hgrepos = []
issue_num = 2569
keywords = []
message_count = 4.0
messages = ['65071', '65072', '68520', '68522']
nosy_count = 3.0
nosy_names = ['facundobatista', 'elachuni', 'pk']
pr_nums = []
priority = 'normal'
resolution = 'duplicate'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue2569'
versions = ['Python 2.5']

@pk
Copy link
Mannequin Author

pk mannequin commented Apr 7, 2008

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

@pk pk mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Apr 7, 2008
@pk
Copy link
Mannequin Author

pk mannequin commented Apr 7, 2008

and this is the url to the old report:

http://mail.python.org/pipermail/python-list/2002-August/157171.html

@elachuni
Copy link
Mannequin

elachuni mannequin commented Jun 21, 2008

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
bpo-754016 adds a docfix clarifying this.

@facundobatista
Copy link
Member

Thanks (pk) and Anthony!

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant