]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] 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:30:15 +0000 (11:30 +0100)
committerGitHub <noreply@github.com>
Sat, 8 Nov 2025 10:30:15 +0000 (10:30 +0000)
commitbe33104f88a62af11b180974f97480ea73fca1ac
tree2fc3df532ec6539404bbe5e6dfe8117c48bd58dc
parent46d96dce63021c5b290508c782001cb9423a1316
[3.13] gh-140793: Improve documentatation and tests for the ensure_ascii option in the json module (GH-140906) (GH-141228)

* 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