diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2015-01-06 14:22:00 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2015-01-06 14:22:00 (GMT) |
commit | b9fdb7a452c2b6f7a628118b5f695bd061b62cc8 (patch) | |
tree | 724c4a77f635adc95e78674ce5f24e79aa391fae /Doc/library/functions.rst | |
parent | fcfed1991382f9697df574fae4115a9f815adca0 (diff) | |
download | cpython-b9fdb7a452c2b6f7a628118b5f695bd061b62cc8.zip cpython-b9fdb7a452c2b6f7a628118b5f695bd061b62cc8.tar.gz cpython-b9fdb7a452c2b6f7a628118b5f695bd061b62cc8.tar.bz2 |
Issue 19548: update codecs module documentation
- clarified the distinction between text encodings and other codecs
- clarified relationship with builtin open and the io module
- consolidated documentation of error handlers into one section
- clarified type constraints of some behaviours
- added tests for some of the new statements in the docs
Diffstat (limited to 'Doc/library/functions.rst')
-rw-r--r-- | Doc/library/functions.rst | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 7108bf9..dad247d 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -939,15 +939,17 @@ are always available. They are listed here in alphabetical order. *encoding* is the name of the encoding used to decode or encode the file. This should only be used in text mode. The default encoding is platform dependent (whatever :func:`locale.getpreferredencoding` returns), but any - encoding supported by Python can be used. See the :mod:`codecs` module for + :term:`text encoding` supported by Python + can be used. See the :mod:`codecs` module for the list of supported encodings. *errors* is an optional string that specifies how encoding and decoding errors are to be handled--this cannot be used in binary mode. - A variety of standard error handlers are available, though any + A variety of standard error handlers are available + (listed under :ref:`error-handlers`), though any error handling name that has been registered with :func:`codecs.register_error` is also valid. The standard names - are: + include: * ``'strict'`` to raise a :exc:`ValueError` exception if there is an encoding error. The default value of ``None`` has the same |