Title: msgpack.fallback DEFAULT_RECURSE_LIMIT smaller than python 3.10 default · Issue #674 · msgpack/msgpack-python · GitHub
Open Graph Title: msgpack.fallback DEFAULT_RECURSE_LIMIT smaller than python 3.10 default · Issue #674 · msgpack/msgpack-python
X Title: msgpack.fallback DEFAULT_RECURSE_LIMIT smaller than python 3.10 default · Issue #674 · msgpack/msgpack-python
Description: Hi there. I was running the pure python msgpack.fallback implementation against this sample.json test file in the tencent/rapidjson repo. Packing hit a ValueError: recursion limit exceeded. It looks like this stems from the DEFAULT_RECUR...
Open Graph Description: Hi there. I was running the pure python msgpack.fallback implementation against this sample.json test file in the tencent/rapidjson repo. Packing hit a ValueError: recursion limit exceeded. It look...
X Description: Hi there. I was running the pure python msgpack.fallback implementation against this sample.json test file in the tencent/rapidjson repo. Packing hit a ValueError: recursion limit exceeded. It look...
Opengraph URL: https://github.com/msgpack/msgpack-python/issues/674
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"msgpack.fallback DEFAULT_RECURSE_LIMIT smaller than python 3.10 default","articleBody":"Hi there. I was running the pure python `msgpack.fallback` implementation against this [sample.json](https://github.com/Tencent/rapidjson/blob/master/bin/data/sample.json) test file in the tencent/rapidjson repo. Packing hit a `ValueError: recursion limit exceeded`.\n\nIt looks like this stems from the [DEFAULT_RECURSE_LIMIT](https://github.com/msgpack/msgpack-python/blob/main/msgpack/fallback.py#L55). Changing to use the `sys.getrecursionlimit()` resolves as it has a [default of 1000](https://github.com/python/cpython/blob/3.10/Python/ceval.c#L799) in 3.10. Looking at the pyproject.toml it seems like support is \u003e= python 3.10 so I think it should be fine to update the constant, or drop it completely in favor of just inheriting the python stack limit. An advantage of doing that is the users ability to control it with `sys.setrecursionlimit()`. Also then a `RecursionError` can be raised instead of `ValueError`.\n\nSimple reproduction:\n\n```python\nfrom msgpack.fallback import Packer\nimport json\n\nwith open('sample.json') as f:\n Packer().pack(json.load(f)) # ValueError\n```\n\nThis works fine, but the public `Packer.pack` api doesn't expose it directly:\n\n```python\nfrom msgpack.fallback import Packer\nimport json\nimport sys\n\nwith open('sample.json') as f:\n Packer()._pack(json.load(f), nest_limit=sys.getrecursionlimit()) # 1000\n```\n\nThanks!","author":{"url":"https://github.com/rsiemens","@type":"Person","name":"rsiemens"},"datePublished":"2026-05-17T16:26:28.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/674/msgpack-python/issues/674"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e8740b94-06d1-6063-4c64-69683bccda44 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9B06:18CEBB:1174503:172C1F4:6A51AAB1 |
| html-safe-nonce | 803450c46f2a8bb8482a9694ef9987d0719bc775d470be71effdbd64c42f66b2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QjA2OjE4Q0VCQjoxMTc0NTAzOjE3MkMxRjQ6NkE1MUFBQjEiLCJ2aXNpdG9yX2lkIjoiNTExMjMzNjI0ODkzODI3NzU1NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 61f341a509f82f15c739303fe846daccd3f54adb4a90015370b0d90fed082481 |
| hovercard-subject-tag | issue:4464137322 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/msgpack/msgpack-python/674/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1da7f6f8f88f58c70f0d05849f883b7304cac70e4bcd52a4a9efa04372dfa196/msgpack/msgpack-python/issues/674 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1da7f6f8f88f58c70f0d05849f883b7304cac70e4bcd52a4a9efa04372dfa196/msgpack/msgpack-python/issues/674 |
| og:image:alt | Hi there. I was running the pure python msgpack.fallback implementation against this sample.json test file in the tencent/rapidjson repo. Packing hit a ValueError: recursion limit exceeded. It look... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rsiemens |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/msgpack/msgpack-python git https://github.com/msgpack/msgpack-python.git |
| octolytics-dimension-user_id | 198264 |
| octolytics-dimension-user_login | msgpack |
| octolytics-dimension-repository_id | 2242705 |
| octolytics-dimension-repository_nwo | msgpack/msgpack-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 2242705 |
| octolytics-dimension-repository_network_root_nwo | msgpack/msgpack-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width