summaryrefslogtreecommitdiff
path: root/Doc/library/urllib.parse.rst
diff options
context:
space:
mode:
authorSenthil Kumaran <orsenthil@gmail.com>2010-08-04 04:50:44 +0000
committerSenthil Kumaran <orsenthil@gmail.com>2010-08-04 04:50:44 +0000
commit84c7d9f87b33282a84ef2bfc9ffe407aa9976243 (patch)
tree6ad12b060828935191d29ab0cd2a1cb34c3142d6 /Doc/library/urllib.parse.rst
parent4aa0d4d2d0ab0232ded3462a31b1584ec199cd64 (diff)
downloadcpython-git-84c7d9f87b33282a84ef2bfc9ffe407aa9976243.tar.gz
Fix Issue754016 - urlparse goes wrong with IP:port without scheme
Diffstat (limited to 'Doc/library/urllib.parse.rst')
-rw-r--r--Doc/library/urllib.parse.rst17
1 files changed, 17 insertions, 0 deletions
diff --git a/Doc/library/urllib.parse.rst b/Doc/library/urllib.parse.rst
index add07a50b6..b915f29498 100644
--- a/Doc/library/urllib.parse.rst
+++ b/Doc/library/urllib.parse.rst
@@ -48,6 +48,23 @@ The :mod:`urllib.parse` module defines the following functions:
>>> o.geturl()
'http://www.cwi.nl:80/%7Eguido/Python.html'
+ If the scheme value is not specified, urlparse following the syntax
+ specifications from RFC 1808, expects the netloc value to start with '//',
+ Otherwise, it is not possible to distinguish between net_loc and path
+ component and would classify the indistinguishable component as path as in
+ a relative url.
+
+ >>> from urlparse import urlparse
+ >>> urlparse('//www.cwi.nl:80/%7Eguido/Python.html')
+ ParseResult(scheme='', netloc='www.cwi.nl:80', path='/%7Eguido/Python.html',
+ params='', query='', fragment='')
+ >>> urlparse('www.cwi.nl:80/%7Eguido/Python.html')
+ ParseResult(scheme='', netloc='', path='www.cwi.nl:80/%7Eguido/Python.html',
+ params='', query='', fragment='')
+ >>> urlparse('help/Python.html')
+ ParseResult(scheme='', netloc='', path='help/Python.html', params='',
+ query='', fragment='')
+
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.