Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document encoding detection behavior for unknown encodings. #2733

Merged
merged 1 commit into from
Feb 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES/2732.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Document behavior when cchardet detects encodings that are unknown to Python.
7 changes: 7 additions & 0 deletions docs/client_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1170,6 +1170,9 @@ Response object

:return str: decoded *BODY*

:raise LookupError: if the encoding detected by chardet or cchardet is
unknown by Python (e.g. VISCII).

.. note::

If response has no ``charset`` info in ``Content-Type`` HTTP
Expand Down Expand Up @@ -1223,6 +1226,10 @@ Response object
are no appropriate codecs for encoding then :term:`cchardet` /
:term:`chardet` is used.

Beware that it is not always safe to use the result of this function to
decode a response. Some encodings detected by cchardet are not known by
Python (e.g. VISCII).

.. versionadded:: 3.0


Expand Down