Title: Honor sys.int_max_str_digits in native json.loads by Federicorao · Pull Request #8087 · RustPython/RustPython · GitHub
Open Graph Title: Honor sys.int_max_str_digits in native json.loads by Federicorao · Pull Request #8087 · RustPython/RustPython
X Title: Honor sys.int_max_str_digits in native json.loads by Federicorao · Pull Request #8087 · RustPython/RustPython
Description: This PR follows our AI policy Refs #8051. Routes the native _json scanner integer path through rustpython_common::int::bytes_to_int with the live vm.state.int_max_str_digits value, matching the int() conversion path and the pure-Python JSON decoder. Adds snippet coverage for the boundary where an integer with exactly the configured digit limit parses, while one digit over the limit raises ValueError. Local verification: python3.14 -m py_compile extra_tests/snippets/stdlib_json.py python3.14 extra_tests/snippets/stdlib_json.py Could not run local Rust checks because cargo is not installed in this environment; CI will validate the Rust crate build and formatting. AI assistance disclosure: OpenAI GPT-5 was used to inspect the issue and review feedback, draft the patch, and run local verification; the changes are disclosed in the commit with an Assisted-by trailer. Summary by CodeRabbit Bug Fixes JSON integer parsing now enforces the VM's integer-string length limit, returning an error for overly long integer literals while preserving correct parsing for valid integers. Tests Added a regression test that verifies the length limit is enforced and that valid integer strings continue to parse successfully.
Open Graph Description: This PR follows our AI policy Refs #8051. Routes the native _json scanner integer path through rustpython_common::int::bytes_to_int with the live vm.state.int_max_str_digits value, matching the in...
X Description: This PR follows our AI policy Refs #8051. Routes the native _json scanner integer path through rustpython_common::int::bytes_to_int with the live vm.state.int_max_str_digits value, matching the in...
Opengraph URL: https://github.com/RustPython/RustPython/pull/8087
X: @github
Domain: Github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:fc664608-a298-6a96-069b-79b9fd50a0f9 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8B52:118906:32BAF8A:341AD60:6A632B3C |
| html-safe-nonce | 60cf7697a41ddd40db59bc93bfba2d7413154b80449a86c9eb438a474a84c8a0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QjUyOjExODkwNjozMkJBRjhBOjM0MUFENjA6NkE2MzJCM0MiLCJ2aXNpdG9yX2lkIjoiMzg3ODQ3ODA5MTM4OTE4NDgyOCIsInJlZ2lvbl9lZGdlIjoic2VhIiwicmVnaW9uX3JlbmRlciI6InNlYSJ9 |
| visitor-hmac | 79e9eaa08e3848c43d25dfc36edde4adc4fd5437867a79d78d8445561634e89b |
| hovercard-subject-tag | pull_request:3854495905 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/RustPython/RustPython/pull/8087/files |
| twitter:image | https://avatars.githubusercontent.com/u/157750791?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/157750791?s=400&v=4 |
| og:image:alt | This PR follows our AI policy Refs #8051. Routes the native _json scanner integer path through rustpython_common::int::bytes_to_int with the live vm.state.int_max_str_digits value, matching the in... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 30c644d502bce6cd2e59f9000b4744f2b64819abea8e8f959b18e3ad793125aa |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 331492a48ebd91d66ef2de38e1901bb911c9fe9b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width