diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-01-14 12:52:12 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-01-14 12:52:12 (GMT) |
commit | ac71c54b88b916e05e4279e9c4306d227f3a6dfe (patch) | |
tree | 0d341e7259e4ad46d0e2b7b0e0f2c50e31b14f87 /Doc/library | |
parent | 489f392a0ed9996492d7c1c124b859160a3f13d3 (diff) | |
download | cpython-ac71c54b88b916e05e4279e9c4306d227f3a6dfe.zip cpython-ac71c54b88b916e05e4279e9c4306d227f3a6dfe.tar.gz cpython-ac71c54b88b916e05e4279e9c4306d227f3a6dfe.tar.bz2 |
Add encoding and errors arguments to urllib.parse_qs() and urllib.parse_qsl()
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/urllib.parse.rst | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Doc/library/urllib.parse.rst b/Doc/library/urllib.parse.rst index e7a75ce..01ac444 100644 --- a/Doc/library/urllib.parse.rst +++ b/Doc/library/urllib.parse.rst @@ -116,7 +116,7 @@ or on combining URL components into a URL string. Added IPv6 URL parsing capabilities. -.. function:: parse_qs(qs, keep_blank_values=False, strict_parsing=False) +.. function:: parse_qs(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace') Parse a query string given as a string argument (data of type :mimetype:`application/x-www-form-urlencoded`). Data are returned as a @@ -133,11 +133,15 @@ or on combining URL components into a URL string. parsing errors. If false (the default), errors are silently ignored. If true, errors raise a :exc:`ValueError` exception. + The optional *encoding* and *errors* parameters specify how to decode + percent-encoded sequences into Unicode characters, as accepted by the + :meth:`bytes.decode` method. + Use the :func:`urllib.parse.urlencode` function to convert such dictionaries into query strings. -.. function:: parse_qsl(qs, keep_blank_values=False, strict_parsing=False) +.. function:: parse_qsl(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace') Parse a query string given as a string argument (data of type :mimetype:`application/x-www-form-urlencoded`). Data are returned as a list of @@ -153,6 +157,10 @@ or on combining URL components into a URL string. parsing errors. If false (the default), errors are silently ignored. If true, errors raise a :exc:`ValueError` exception. + The optional *encoding* and *errors* parameters specify how to decode + percent-encoded sequences into Unicode characters, as accepted by the + :meth:`bytes.decode` method. + Use the :func:`urllib.parse.urlencode` function to convert such lists of pairs into query strings. |