[docs] [issue23684] urlparse() documentation does not account for default scheme

Martin Panter report at bugs.python.org
Tue Mar 17 02:39:42 CET 2015


New submission from Martin Panter:

The documentation for urlsplit() says:

'''
urlparse(urlstring, scheme='', allow_fragments=True)

. . .

If the scheme argument is specified, it gives the default addressing scheme, to be used only if the URL does not specify one. The default value for this argument is the empty string.
'''

However this contradicts the table of attributes, which gives:

Attribute: scheme, . . . Value if not present: empty string

Similarly for urlsplit(). Of course, the description of the “scheme” parameter is correct, and the table is only correct when no “scheme” parameter is given:

>>> urlparse("//example.net").scheme
''
>>> urlparse(b"//example.net").scheme
b''
>>> urlparse("//example.net", "http").scheme
'http'

This issue is split off another where I tried to sneak in a quick fix, but the wording probably needs more thought. Original change: <https://bugs.python.org/review/22852/patch/14176/52720#old-line-92>.

Maybe change it to this?

Value if not present: empty string or default scheme

----------
assignee: docs at python
components: Documentation
messages: 238253
nosy: docs at python, vadmium
priority: normal
severity: normal
status: open
title: urlparse() documentation does not account for default scheme

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23684>
_______________________________________


More information about the docs mailing list