diff options
author | Senthil Kumaran <orsenthil@gmail.com> | 2010-08-04 04:45:31 (GMT) |
---|---|---|
committer | Senthil Kumaran <orsenthil@gmail.com> | 2010-08-04 04:45:31 (GMT) |
commit | 0b5019fe2376ed6ef2aaf61ff9cbc8e6b090bc56 (patch) | |
tree | 33f9f2f49322aad97d20169ada9767fe8b411d01 /Doc | |
parent | 75a292e5be429977656acaf846345be9dc0a6b8e (diff) | |
download | cpython-0b5019fe2376ed6ef2aaf61ff9cbc8e6b090bc56.zip cpython-0b5019fe2376ed6ef2aaf61ff9cbc8e6b090bc56.tar.gz cpython-0b5019fe2376ed6ef2aaf61ff9cbc8e6b090bc56.tar.bz2 |
Fix Issue754016 - urlparse goes wrong with IP:port without scheme
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/urlparse.rst | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Doc/library/urlparse.rst b/Doc/library/urlparse.rst index 1f58023..c3eb559 100644 --- a/Doc/library/urlparse.rst +++ b/Doc/library/urlparse.rst @@ -58,6 +58,24 @@ The :mod:`urlparse` 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. |