mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:50:53 +01:00
[PR #196] [CLOSED] awc_shorts: refuse a catalog destination that aliases an input bank #248
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#248
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/196
Author: @Andretuta
Created: 11/24/2026
Status: ❌ Closed
Base:
main← Head:old-pr/9927📝 Commits (1)
2496befawc_shorts: refuse a catalog destination that aliases an input bank📊 Changes
2 files changed (+35 additions, -1 deletions)
View changed files
📝
tests/test_awc_shorts.py(+26 -0)📝
tools/awc_shorts.py(+9 -1)📄 Description
Original description (mentions and
#Nreferences are disabled; the numbers refer to the old repository):Claimed in the coordination issue: https://github.com/ProjectLeonida/Leonida/issues/9677 (from finding by
@kawaii-shakal: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7115664188)Depends on: none.
What and why
In
tools/awc_shorts.py, the output catalog was previously published to<out>/shorts.csvwithout verifying whether that path collided with an input bank. When an input bank was namedshorts.csvor exported into a directory of that name, publishing the catalog replaced the source input file with the CSV header/rows and exited 0.Fix:
same_report_pathfromreport_paths.<out>/shorts.csvaliases any bank inbanks, reportingawc_shorts: error: catalog would overwrite the input bank <path>and exiting 2.<out>/shorts.csvcollides with any bank export directory<out>/<bank>, reportingawc_shorts: error: catalog would collide with bank export directory <target>and exiting 2.Tested
main(5d74c2723):An input file
shorts.csvwas overwritten with CSV contents and exited with returncode 0.fix/awc-shorts-protect-input-catalog:The collision is refused with exit code 2 and diagnostic message before directory creation; input file contents remain untouched.
python -I tests/test_awc_shorts.py-> 17 tests passed (1 expected skip: case-distinct test on Windows).python -m compileall -q tools/awc_shorts.py tests/test_awc_shorts.py: clean.python -I scripts/check_no_game_data.py tools/awc_shorts.py tests/test_awc_shorts.py: clean.git diff --check origin/main: clean.AI-assisted: yes.
Checklist
docs/design.md, with how it was confirmed. (Not applicable: no translator change.)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.