Replace oversized int literals with 0 to avoid json.dumps 4300-digit conversion limit#35
Merged
ParzivalHack merged 1 commit intoParzivalHack:mainfrom Feb 11, 2026
Conversation
ParzivalHack
approved these changes
Feb 11, 2026
Owner
ParzivalHack
left a comment
There was a problem hiding this comment.
Hey @satoridev01, thanks for the PR, merging this one directly as i require not further changes. Thx again :)
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.
When PySpector processes the following:
https://github.com/SheafificationOfG/BoolosBrewery/blob/18670136ed43ca9ed30bf6b701b47fc48307bfa7/submissions/public/hard/20241015_010940_viliml_simpler_sat.py#L7
A stacktrace is shown:
satori run satori://code/python/pyspector.yml --repo SheafificationOfG/BoolosBrewery --outputWhen
ast.parse()parses the file, it creates AST Constant nodes with those huge integers. Thenjson.dumps()tries to convert them to strings and hits Python 3.12's int-to-string security limit (CVE-2020-10735), which caps conversions at 4,300 digits by default.This is a bug in PySpector's AstEncoder — it should handle huge integers gracefully instead of letting json.dumps crash. The fix would be in cli.py's
AstEncoder.default()method, converting very large ints to a 0 before serialization.With this fix, it is possible to parse that repo:
