[docs] [issue10226] urlparse example is wrong

Alexander Belopolsky report at bugs.python.org
Fri Oct 29 07:26:06 CEST 2010

New submission from Alexander Belopolsky <belopolsky at users.sourceforge.net>:

The following example in Doc/library/urlparse.rst is wrong

>>> urlparse('www.cwi.nl:80/%7Eguido/Python.html')
ParseResult(scheme='', netloc='', path='www.cwi.nl:80/%7Eguido/Python.html',
           params='', query='', fragment='')

In the actual output, scheme='www.cwi.nl'.

In addition, the preceding text is confusing and probably not grammatical:

Otherwise, it is not possible to distinguish between netloc and path components, and would the indistinguishable component would be classified as the path as in a relative URL.

Discovered while working on issue 10225.

assignee: docs at python
components: Documentation
messages: 119855
nosy: belopolsky, docs at python
priority: normal
severity: normal
status: open
title: urlparse example is wrong
versions: Python 2.7, Python 3.1, Python 3.2

Python tracker <report at bugs.python.org>

More information about the docs mailing list