mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:45:53 +01:00
[PR #1155] [MERGED] gallery: reject invalid explicit asset directories (GALLERY-EXPLICIT-DIRS) #1188
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#1188
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/1155
Author: @Okachamie
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @QemmHD
Base:
main← Head:t3/gallery-explicit-dirs📝 Commits (1)
804a341gallery: reject invalid explicit asset directories📊 Changes
2 files changed (+39 additions, -0 deletions)
View changed files
📝
tests/test_gallery.py(+36 -0)📝
tools/gallery.py(+3 -0)📄 Description
Claimed in the coordination issue as: GALLERY-EXPLICIT-DIRS (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7141680796)
What and why
gallery.mainnow rejects an explicitly supplied--models-diror--textures-dirwhen it is not a directory, reporting an argparse error and exiting 2 beforestart_serverruns. Omitted flags remainNone, so the existing auto-discovery/default-directory behavior is unchanged; usable explicit directories are passed through unchanged.Synthetic CLI tests cover missing paths, regular files, and empty strings for both flags, plus valid explicit directories. No game files or GPU are needed.
Tested
Linux x86-64, CPython 3.14.10, synthetic fixtures only:
python -I tests/test_gallery.py: 29 tests, OK.python -I tests/test_gallery.py TestGalleryCommandLine.test_rejects_non_directory_explicit_paths_before_starting_server -v: 1 test with 6 expected failures (SystemExit not raised) before the fix.python -I tests/test_gallery.py: 31 tests, OK in 9.126s. The existingHTTPError 400ResourceWarningremains; no test failures.python -m compileall -q tools/gallery.py tests/test_gallery.py: exit 0.python -I scripts/check_no_game_data.py tools/gallery.py tests/test_gallery.py: exit 0.git diff --check: exit 0.GPUs tested: n/a
AI-assisted: yes
Checklist
main(6293c1c4f88c7ea2088ec595fea51362f1759996) and merges cleanly.docs/design.md, with how it was confirmed. (n/a: no translator change)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.