build_web leaks RecursionError for deeply nested release JSON #12383

Closed
opened 2026-10-28 12:07:17 +00:00 by malekaifa · 0 comments
malekaifa commented 2026-10-28 12:07:17 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by malekaifa on 2026-10-28T12:07:17Z.


What happens

tools/build_web.py --release reads the GitHub latest-release response with json.load(response). A valid but excessively deeply nested JSON response raises RecursionError and escapes as a raw traceback (exit 1), instead of following the tool's existing malformed-release error path.

Current-main reproduction on 2227f1366188cda5699dd20e2e756a18006a5d4b:

  • make build_web.request return raw JSON consisting of a very deeply nested array;
  • invoke build_web.main(['--build', <temp>, '--release']);
  • result: uncaught RecursionError from json.load(response), exit 1 with traceback.

Existing tools.tests.test_build_web passes 16/16.

Expected behavior

Malformed or unusably deep release metadata should be reported through the existing argparse usage-error boundary: exit 2, concise diagnostic, no traceback, and no site mutation.

Proposed scope

  • Keep the fix local to the release-metadata JSON decode boundary.
  • Do not broadly catch unrelated RecursionError elsewhere.
  • Add a deterministic regression in tools/tests/test_build_web.py using raw deeply nested JSON or a narrowly injected decoder recursion failure.
  • Preserve valid release publication behavior.

Ownership / overlap

A fresh exhaustive scan of open PRs found no open PR touching tools/build_web.py or tools/tests/test_build_web.py. Current-main movement since the scouting snapshot did not change either file. Targeted open issue/PR searches for build_web, release metadata recursion, and deeply nested release JSON found no owner.

AI-assisted: yes (OpenAI Codex)

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:6078594315 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/12383). Originally posted by [malekaifa](https://github.com/malekaifa) on 2026-10-28T12:07:17Z. --- ### What happens `tools/build_web.py --release` reads the GitHub latest-release response with `json.load(response)`. A valid but excessively deeply nested JSON response raises `RecursionError` and escapes as a raw traceback (exit 1), instead of following the tool's existing malformed-release error path. Current-main reproduction on `2227f1366188cda5699dd20e2e756a18006a5d4b`: - make `build_web.request` return raw JSON consisting of a very deeply nested array; - invoke `build_web.main(['--build', <temp>, '--release'])`; - result: uncaught `RecursionError` from `json.load(response)`, exit 1 with traceback. Existing `tools.tests.test_build_web` passes 16/16. ### Expected behavior Malformed or unusably deep release metadata should be reported through the existing argparse usage-error boundary: exit 2, concise diagnostic, no traceback, and no site mutation. ### Proposed scope - Keep the fix local to the release-metadata JSON decode boundary. - Do not broadly catch unrelated `RecursionError` elsewhere. - Add a deterministic regression in `tools/tests/test_build_web.py` using raw deeply nested JSON or a narrowly injected decoder recursion failure. - Preserve valid release publication behavior. ### Ownership / overlap A fresh exhaustive scan of open PRs found no open PR touching `tools/build_web.py` or `tools/tests/test_build_web.py`. Current-main movement since the scouting snapshot did not change either file. Targeted open issue/PR searches for `build_web`, release metadata recursion, and deeply nested release JSON found no owner. AI-assisted: yes (OpenAI Codex)
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#12383
No description provided.