]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] gh-140793: Improve documentatation and tests for the ensure_ascii option in...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 8 Nov 2025 10:32:44 +0000 (11:32 +0100)
committerGitHub <noreply@github.com>
Sat, 8 Nov 2025 10:32:44 +0000 (10:32 +0000)
commit24619962e01f54e5e2be6f170723027b2ead809a
tree33dc364fb746aed5b6807952b5e9412527d352bd
parentde00dde9dedcf727956b4ff0f3b26230f1081583
[3.14] gh-140793: Improve documentatation and tests for the ensure_ascii option in the json module (GH-140906) (GH-141227)

* Document that ensure_ascii=True forces escaping not only non-ASCII, but also
  non-printable characters (the only affected ASCII character is U+007F).
* Ensure that the help output for the json module does not exceed 80
  columns (except one long line in an example and generated lines).
* Add more tests.
(cherry picked from commit 7e90bac3cc6fd68fe6696ab4bce1262751de7531)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Doc/library/json.rst
Lib/json/__init__.py
Lib/json/decoder.py
Lib/json/encoder.py
Lib/test/test_json/test_encode_basestring_ascii.py
Lib/test/test_json/test_unicode.py