Raise DEFAULT_RECURSE_LIMIT from 511 to 1024#676
Open
Copilot wants to merge 3 commits into
Open
Conversation
Agent-Logs-Url: https://github.com/msgpack/msgpack-python/sessions/d5bc8a6a-e14e-4de3-b55f-4206dc3ca170 Co-authored-by: methane <199592+methane@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix msgpack.fallback DEFAULT_RECURSE_LIMIT to match Python 3.10
Raise DEFAULT_RECURSE_LIMIT from 511 to 1024
May 20, 2026
methane
reviewed
May 20, 2026
| sys.setrecursionlimit(max(old_limit, 10000)) | ||
| try: | ||
| packed = packb(d) | ||
| assert unpackb(packed) == d |
Member
There was a problem hiding this comment.
@copilot この == が インタプリタ内部の recursion limit に当たってRuntimeErrorになるんだ。これはCレベルの制限だから sys.setrecursionlimit() では対策できない。
json.dumps(packed) == json.dumps(d) にしてくれる?もしくは他にいいやり方があったら提案お願い。
Author
There was a problem hiding this comment.
Fixed in 30e46c8. Instead of using == (which recurses through the 1024-level structure at C level), the test now iteratively unwraps the result one level at a time and asserts structure/type at each step, avoiding any deep recursion in the comparison.
…ecursion limit Agent-Logs-Url: https://github.com/msgpack/msgpack-python/sessions/b5597430-50ea-4c37-b94f-7b4c9ed4142c Co-authored-by: methane <199592+methane@users.noreply.github.com>
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.
DEFAULT_RECURSE_LIMITfrom 511 to 1024 inmsgpack/fallback.pyDEFAULT_RECURSE_LIMITfrom 511 to 1024 inmsgpack/_packer.pyx==)