diff options
author | Senthil Kumaran <orsenthil@gmail.com> | 2010-08-04 04:53:07 (GMT) |
---|---|---|
committer | Senthil Kumaran <orsenthil@gmail.com> | 2010-08-04 04:53:07 (GMT) |
commit | 8801f7add244421305a3c555cff56d27798b0946 (patch) | |
tree | f4c909a9c6084fd9407614649559be2adce9931c /Doc | |
parent | 9b3383ca65fc0181e3b7a6aacae3539de545591f (diff) | |
download | cpython-8801f7add244421305a3c555cff56d27798b0946.zip cpython-8801f7add244421305a3c555cff56d27798b0946.tar.gz cpython-8801f7add244421305a3c555cff56d27798b0946.tar.bz2 |
Merged revisions 83701 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r83701 | senthil.kumaran | 2010-08-04 10:20:44 +0530 (Wed, 04 Aug 2010) | 3 lines
Fix Issue754016 - urlparse goes wrong with IP:port without scheme
........
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/urllib.parse.rst | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Doc/library/urllib.parse.rst b/Doc/library/urllib.parse.rst index c9ca9ab..72b8028 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. |