]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-140793: Improve documentatation and tests for the ensure_ascii option in the json...
authorSerhiy Storchaka <storchaka@gmail.com>
Sat, 8 Nov 2025 10:07:27 +0000 (12:07 +0200)
committerGitHub <noreply@github.com>
Sat, 8 Nov 2025 10:07:27 +0000 (12:07 +0200)
commit7e90bac3cc6fd68fe6696ab4bce1262751de7531
treee6cfe9f7da73730695d7f41eb525012eb0319353
parent8cec3d3a9d827aadc7008ab4312121fcf28329c6
gh-140793: Improve documentatation and tests for the ensure_ascii option in the json module (GH-140906)

* 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.
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