Repository navigation
Fix parse_mode flags without native or NaN number modes - #243
Open
ryanduguid wants to merge 1 commit into
Open
ryanduguid wants to merge 1 commit into
ryanduguid wants to merge 1 commit into
Conversation
Contributor
|
Thanks for the report and fix! I will try to dedicate some time to RJ next week. |
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.
Comments and trailing commas are not consistently honoured when
number_modeisNone,NM_NONEorNM_DECIMAL, or whenallow_nan=Falseselects the same decoder path. The sharedDECODEmacro omits the comments-only branch and drops the trailing-comma flag when both extensions are requested.For example, this raises
JSONDecodeErroron the base and returns[1.5]with the fix:The fix follows the existing flag-dispatch pattern, retaining
kParseNumbersAsStringsFlagin both corrected selections. The tests reuse the six-form decoding fixture to coverloads,loadandDecoder, plus the directallow_nan=Falseroutes. They check nested syntax, float/Decimal types, arbitrary-size integers, strict rejection and literal comment-like strings.Verification
make -C docs doctestandstubtest rapidjsonpass on Linux 3.13; the configured Sphinx doctest command and stubtest pass on Windows 3.13. Both doctest runs pass all 274 examples. Stubtest also passes on Linux 3.14 and 3.15rc3.-O.Risk and unverified checks
This changes accepted syntax only in the two corrected dispatch selections. Numeric representation and NaN rejection are covered by the regression and additional controls.
The Linux 3.14 doctest run fails the native-mode large-integer example at
docs/loads.rst:114; a separate immutable-base build reproduces the identical final-digit difference. Debug builds, stable Python 3.15, Python 3.10 doctests/stubtest, Python 3.15rc3 doctests, macOS, other wheel architectures, hosted CI, sanitiser runs, benchmarks and scanner parser coverage are unverified. The stale Python 3.9 tox environments were not run; the repository has no configured lint command.