mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:20:53 +01:00
[PR #2278] dev: accept argv, guard stdout.reconfigure, and reject whitespace --out #2281
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2281
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2278
Author: @kirigayakazima
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:fix/dev-cli-safety📝 Commits (1)
0da9526dev: accept argv, guard stdout.reconfigure, and reject whitespace --out📊 Changes
2 files changed (+34 additions, -4 deletions)
View changed files
📝
scripts/dev.py(+7 -4)📝
tests/test_dev_discovery.py(+27 -0)📄 Description
Claimed in the coordination issue as: DEV-CLI-STDOUT-RECONFIGURE-AND-ARGV-SAFETY (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7191757339)
What and why
scripts/dev.pypreviously:main()with noargvparameter, preventing programmatic or in-process testing.sys.stdout.reconfigure(encoding="utf-8")unguarded indiscover, raisingAttributeErrorwhensys.stdoutis replaced withio.StringIOor another non-reconfigurable stream.--out " "as a valid--out PATHinguest-scene.This adds
argv: list[str] | None = Nonetomain(), wrapssys.stdout.reconfigure(encoding="utf-8")intry/except (AttributeError, ValueError, OSError), rejects whitespace-only--outinguest_scene(), and adds unit tests intests/test_dev_discovery.py.Tested
python -I tests/test_dev_discovery.py -v(5 passed)python -I tests/test_dev_guest_scene.py -v(4 passed)upstream/mainbaseline negative control: failed withtests/test_dev_discovery.pybefore the fixpython -I tests/test_ci_registration.py,python -I tests/test_text_write_line_endings.py,python -I scripts/check_no_game_data.py,python -I -m compileall -q, andgit diff --cached --checkGPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.