diff options
author | R David Murray <rdmurray@bitdance.com> | 2014-12-25 02:24:07 (GMT) |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2014-12-25 02:24:07 (GMT) |
commit | 3ab6ba474410b2f49d3a76766999effa59875024 (patch) | |
tree | 2d929ebb78357a5d9044797f7779ca2bd439e848 /Lib/urllib | |
parent | 3226f9618f1dfacc7d0a98b0821f8ab5b180e482 (diff) | |
parent | 8c4e112afcf6b2236c43273d007de5b61d4b6519 (diff) | |
download | cpython-3ab6ba474410b2f49d3a76766999effa59875024.zip cpython-3ab6ba474410b2f49d3a76766999effa59875024.tar.gz cpython-3ab6ba474410b2f49d3a76766999effa59875024.tar.bz2 |
Merge: #23040: Clarify treatment of encoding and errors when component is bytes.
Diffstat (limited to 'Lib/urllib')
-rw-r--r-- | Lib/urllib/parse.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py index 8bbeab6..821dae6 100644 --- a/Lib/urllib/parse.py +++ b/Lib/urllib/parse.py @@ -687,8 +687,8 @@ def quote(string, safe='/', encoding=None, errors=None): called on a path where the existing slash characters are used as reserved characters. - string and safe may be either str or bytes objects. encoding must - not be specified if string is a str. + string and safe may be either str or bytes objects. encoding and errors + must not be specified if string is a bytes object. The optional encoding and errors parameters specify how to deal with non-ASCII characters, as accepted by the str.encode method. @@ -760,8 +760,9 @@ def urlencode(query, doseq=False, safe='', encoding=None, errors=None): 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, encoding, and errors parameters are passed down to quote_plus() + (encoding and errors only if a component is a str). """ if hasattr(query, "items"): |