]> granicus.if.org Git - python/commit
bpo-37388: Development mode check encoding and errors (GH-14341)
authorVictor Stinner <vstinner@redhat.com>
Tue, 25 Jun 2019 22:51:05 +0000 (00:51 +0200)
committerGitHub <noreply@github.com>
Tue, 25 Jun 2019 22:51:05 +0000 (00:51 +0200)
commit22eb689cf3de7972a2789db3ad01a86949508ab7
treea1d63fa4cf235008e73f92a18ebef57be54ce4a5
parente1a63c4f21011a3ae77dff624196561070c83446
bpo-37388: Development mode check encoding and errors (GH-14341)

In development mode and in debug build, encoding and errors arguments
are now checked on string encoding and decoding operations. Examples:
open(), str.encode() and bytes.decode().

By default, for best performances, the errors argument is only
checked at the first encoding/decoding error, and the encoding
argument is sometimes ignored for empty strings.
Doc/library/stdtypes.rst
Doc/using/cmdline.rst
Doc/whatsnew/3.9.rst
Lib/_pyio.py
Lib/test/test_bytes.py
Lib/test/test_io.py
Lib/test/test_unicode.py
Misc/NEWS.d/next/Core and Builtins/2019-06-24-21-53-52.bpo-37388.0XTZmW.rst [new file with mode: 0644]
Modules/_io/textio.c
Objects/unicodeobject.c