Skip to content

Conversation

shaod2
Copy link
Member

@shaod2 shaod2 commented May 21, 2025

No description provided.

@shaod2 shaod2 added the 🅰️ safe for tests Mark a commit as safe to run presubmits over label May 21, 2025
@github-actions github-actions bot removed the 🅰️ safe for tests Mark a commit as safe to run presubmits over label May 21, 2025
@shaod2 shaod2 marked this pull request as ready for review May 21, 2025 18:48
@shaod2 shaod2 requested a review from a team as a code owner May 21, 2025 18:48
@shaod2 shaod2 requested review from haberman and zhangskz and removed request for a team and haberman May 21, 2025 18:48
@shaod2 shaod2 changed the title Manually backport recursion limit enforcement to 25.x Manually backport Pure Python recursion limit enforcement to 25.x May 21, 2025
@mkruskal-google mkruskal-google added back-port Cherrypick PRs to release branches python labels May 21, 2025
@shaod2 shaod2 added the 🅰️ safe for tests Mark a commit as safe to run presubmits over label May 21, 2025
@github-actions github-actions bot removed the 🅰️ safe for tests Mark a commit as safe to run presubmits over label May 21, 2025
@shaod2 shaod2 merged commit 29445be into protocolbuffers:25.x May 21, 2025
143 of 144 checks passed
@zerlok
Copy link

zerlok commented Jun 13, 2025

Backward compatibility with 4.25.7 was broken here.

Now I'm getting google.protobuf.message.DecodeError: Error parsing message: too many levels of nesting. with data structure with more than 100 nested objects.

Is there a way to increase this limit in my code?

@shaod2
Copy link
Member Author

shaod2 commented Jun 18, 2025

Try adding

from google.protobuf.internal import decoder
...
decoder.SetRecursionLimit({YOUR_LIMIT})

https://github.com/protocolbuffers/protobuf/blob/25.x/python/google/protobuf/internal/decoder.py#L997

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
back-port Cherrypick PRs to release branches python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants