diff -r 35b7dde7fd53 Doc/library/urllib.parse.rst --- a/Doc/library/urllib.parse.rst Fri Dec 12 13:19:48 2014 +0100 +++ b/Doc/library/urllib.parse.rst Fri Dec 12 16:29:26 2014 +0100 @@ -537,8 +537,11 @@ the value sequence for the key. The order of parameters in the encoded string will match the order of parameter tuples in the sequence. - When *query* parameter is a :class:`str`, the *safe*, *encoding* and *error* - parameters are passed down to :func:`quote_plus` for encoding. + The *safe* parameter lists the ASCII characters that should not be percent- + encoded. Spaces are always replaced with the ``'+'`` character. + + When *query* parameter is a :class:`str`, *encoding* and *error* parameters + are passed down to :func:`quote_plus` for encoding. To reverse this encoding process, :func:`parse_qs` and :func:`parse_qsl` are provided in this module to parse query strings into Python data structures. diff -r 35b7dde7fd53 Lib/urllib/parse.py --- a/Lib/urllib/parse.py Fri Dec 12 13:19:48 2014 +0100 +++ b/Lib/urllib/parse.py Fri Dec 12 16:29:26 2014 +0100 @@ -759,9 +759,11 @@ parameters in the output will match the order of parameters in the input. - The components of a query arg may each be either a string or a bytes type. - When a component is a string, the safe, encoding and error parameters are - sent to the quote_plus function for encoding. + The safe arg may list ASCII characters or bytes that will not be encoded. + + The components of the query arg may each be either str or bytes objects, + they will be encoded using the quote_plus function. If a component is a + string, encoding and error parameters are sent to quote_plus for encoding. """ if hasattr(query, "items"):