Skip to content

Convert deep traceback dictionaries without recursion - #92

Open
ShahadatTest wants to merge 1 commit into
ionelmc:masterfrom
ShahadatTest:fix/iterative-traceback-dictionaries
Open

ShahadatTest wants to merge 1 commit into
ionelmc:masterfrom
ShahadatTest:fix/iterative-traceback-dictionaries

Conversation

@ShahadatTest

Copy link
Copy Markdown

Traceback.__init__ already handles chains iteratively, but as_dict() and from_dict() still recurse once per frame. Converting a traceback deeper than the recursion limit raises RecursionError, including when attempting to report an original recursion failure.

Build the linked dictionary and intermediate traceback nodes iteratively. from_dict constructs the final Traceback only once, retaining the existing metadata and optional-local handling. Add deep-chain regressions, a changelog entry and contributor credit.

Validation on Windows:

  • Both new deep-chain tests fail with RecursionError on unchanged master and pass after the fix.
  • Python 3.12.10: 66 tests passed, including existing round-trip, exception-pickling, pytest-integration and README tests. Benchmarks ran in disabled/functional mode.
  • Python 3.10.20: 64 passed, 2 expected ExceptionGroup-version skips.
  • Python 3.12 full suite coverage: 95.88% combined statement/branch coverage. New loop paths are covered.
  • Ruff and changed-file formatting pass (the intentionally invalid tests/badsyntax.py fixture is excluded from full lint, as in pre-commit). Final diff inspected; whitespace check passes.

Checked current contribution instructions, all open PRs, and existing recursion reports. Earlier #16 fixes construction, not these dictionary conversions; no overlapping open fix was found.

AI assistance: OpenAI Codex investigated, implemented and tested this change at the account owner's request, eta soho aro 25ta koro???. No independent human review is claimed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant