Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Passing
ensure_asciitoBox.to_json()orBoxList.to_json()currently raisesTypeError: json.dumps() got multiple values for keyword argument 'ensure_ascii'. The shared converter supplies the option explicitly while also forwarding it fromjson_kwargs. File output has the same problem throughjson.dump().Set
ensure_ascii=Falseonly when the caller has not provided it. This preserves the existing Unicode output by default and allows callers to request escaped ASCII JSON. It also covers the existing multiline file-output path.The tests check exact serialized text and round-trip values for both public classes, strings and files, explicit true/false and the unchanged default, Unicode keys/values and emoji, ASCII file encoding, multiline files, and other JSON options. Includes the changelog and contributor entries requested by CONTRIBUTING.rst; targets
develop.Validation on Linux / CPython 3.12.14:
black --check --config=.black.toml box test setup.py(24.10.0): passed.mypy box(1.13.0): passed, eight source files.CC=gcc python setup.py build_ext --inplace -j 2andgit diff --check: passed.Optional test dependencies were installed from the project requirements. Other Python versions and operating systems were not run locally.