summaryrefslogtreecommitdiffstats
path: root/Doc/library/urllib.parse.rst
diff options
context:
space:
mode:
authorRatnadeep Debnath <rtnpro@gmail.com>2017-02-25 09:00:28 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2017-02-25 09:00:28 (GMT)
commit21024f06622c4c55b666adb130797a4ee205d005 (patch)
tree8b5f5381deb999d248430f3b2b8e351936e72fe8 /Doc/library/urllib.parse.rst
parent140792bd514ee4ba739fda899785bea3ce746f05 (diff)
downloadcpython-21024f06622c4c55b666adb130797a4ee205d005.zip
cpython-21024f06622c4c55b666adb130797a4ee205d005.tar.gz
cpython-21024f06622c4c55b666adb130797a4ee205d005.tar.bz2
bpo-16285: Update urllib quoting to RFC 3986 (#173)
* bpo-16285: Update urllib quoting to RFC 3986 urllib.parse.quote is now based on RFC 3986, and hence includes `'~'` in the set of characters that is not escaped by default. Patch by Christian Theune and Ratnadeep Debnath.
Diffstat (limited to 'Doc/library/urllib.parse.rst')
-rw-r--r--Doc/library/urllib.parse.rst6
1 files changed, 5 insertions, 1 deletions
diff --git a/Doc/library/urllib.parse.rst b/Doc/library/urllib.parse.rst
index 676321b..7a5b56f 100644
--- a/Doc/library/urllib.parse.rst
+++ b/Doc/library/urllib.parse.rst
@@ -451,13 +451,17 @@ task isn't already covered by the URL parsing functions above.
.. function:: quote(string, safe='/', encoding=None, errors=None)
Replace special characters in *string* using the ``%xx`` escape. Letters,
- digits, and the characters ``'_.-'`` are never quoted. By default, this
+ digits, and the characters ``'_.-~'`` are never quoted. By default, this
function is intended for quoting the path section of URL. The optional *safe*
parameter specifies additional ASCII characters that should not be quoted
--- its default value is ``'/'``.
*string* may be either a :class:`str` or a :class:`bytes`.
+ .. versionchanged:: 3.7
+ Moved from RFC 2396 to RFC 3986 for quoting URL strings. "~" is now
+ included in the set of reserved characters.
+
The optional *encoding* and *errors* parameters specify how to deal with
non-ASCII characters, as accepted by the :meth:`str.encode` method.
*encoding* defaults to ``'utf-8'``.