Skip to content

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Nov 2, 2025

ensure_ascii=True forces escaping not only non-ASCII, but also non-printable characters (the only affected ASCII character is U+007F).

Ensure also that the help output for the json module does not exceed 80 columns (except one long line in an example and generated lines).


📚 Documentation preview 📚: https://cpython-previews--140906.org.readthedocs.build/

…in the json module

ensure_ascii=True forces escaping not only non-ASCII, but also
non-printable characters (the only affected ASCII character is U+007F).

Ensure also that the help output for the json module does not exceed 80
columns (except one long line in an example and generated lines).
@serhiy-storchaka serhiy-storchaka added the tests Tests in the Lib/test dir label Nov 2, 2025
@serhiy-storchaka serhiy-storchaka merged commit 7e90bac into python:main Nov 8, 2025
46 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Docs PRs Nov 8, 2025
@miss-islington-app
Copy link

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

@serhiy-storchaka serhiy-storchaka deleted the docs-json-ensure_ascii branch November 8, 2025 10:07
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 8, 2025
…ii option in the json module (pythonGH-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.
(cherry picked from commit 7e90bac)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-app
Copy link

bedevere-app bot commented Nov 8, 2025

GH-141227 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Nov 8, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 8, 2025
…ii option in the json module (pythonGH-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.
(cherry picked from commit 7e90bac)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-app
Copy link

bedevere-app bot commented Nov 8, 2025

GH-141228 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Nov 8, 2025
serhiy-storchaka added a commit that referenced this pull request Nov 8, 2025
…cii 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 7e90bac)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit that referenced this pull request Nov 8, 2025
…cii 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 7e90bac)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@efimov-mikhail efimov-mikhail changed the title gh-140793: Improve documentatation for the ensure_ascii option in the json module gh-140793: Improve documentation for the ensure_ascii option in the json module Nov 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news tests Tests in the Lib/test dir

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant