leonida_mods: install accepts the file names pack writes (MODS-PACKAGE-FILE-NAMES) #1835
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1835"
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?
Imported from ubiquitarianism/leonida. Originally posted by RK28A on 2026-11-25T12:51:13Z.
Claimed in the coordination issue as: MODS-PACKAGE-FILE-NAMES
What and why
installchecked each file name of a package againstsafe_folder_name(). That function makes a tidy folder label so it also collapses double spaces and cuts at 80 characters. A mod with a file likeread me.txtor a name longer than 80 characters was packed bypackand then refused byinstallas an unsafe ZIP member name.Package names are now refused only when they hold a path separator or a reserved character or end with a dot or a space or are a Windows device name.
packruns the same check before it writes so it never writes a package thatinstallrefuses.Tested
python -I tests/test_mod_package_names.pypasses with 5 tests and all 5 fail without the change.tests/test_leonida_mods.pyandtests/test_mod_pack_output_alias.pystill pass. I compared the old and the new check on 400,000 generated names and no unsafe name is accepted. Linux and Python 3.13.GPUs 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. (n/a: no translator change)Imported from ubiquitarianism/leonida. Originally posted by RK28A on 2026-11-25T12:55:24Z.
I used an AI for code and text formatting and for help on the parts I could not get working
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T12:21:38Z.
#1835 | head
58f14c3d68(merged cleanly with maind48a957bb) |python -I tests/test_mod_package_names.py| red on main:FAILED (failures=3, errors=6, skipped=1)(safe_folder_namerejected valid repeated-space, Unicode-space, and >80-char member names while acceptingCOM1 .log) | green on PR+main:5 tests OK (skipped=1)| Windows 11, Python 3.12.10 | AI-assisted: yesAudited
portable_name,zip_parts, andpack_modintools/leonida_mods.pyanddocs/modding.md(separating member-name portability validation fromsafe_folder_namelabel sanitization, rejecting Windows reserved device stems with trailing spaces before.such asCOM1 .log, and checkingzip_partsduringpacksoinstallaccepts every archivepackproduces). Also verified clean merge (0conflicts) and combined execution with #1834 (15 OKintests/test_leonida_mods.py,5 OK (skipped=1)intests/test_mod_package_names.py), plustests/test_docs_encoding.py(1 OK),tests/test_ci_registration.py(18 OK),tests/test_runner_calls_all_tests.py(3 OK),tests/test_text_write_line_endings.py(3 OK), andscripts/check_no_game_data.py.Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T20:15:55Z.
Red/green: On main test_mod_package_names.py has 3 failures and 6 errors (install refuses as unsafe ZIP member names that pack itself writes), and with the PR 5 tests pass (1 skipped) on Windows 11 at OreoFR's (RTX 4070).
Independent tester (OreoFR, RTX 4070, Windows 11): PR head merged with the other PRs of its batch on main
c1ecf04ed, full ctest run (485 tests, tests that launch the game excluded): no new failure compared with main.Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T21:54:52Z.
Verified by OreoFR
3408969a7+ PR head58f14c3d6python -I tests/test_mod_package_names.pyAI-assisted (Claude Code, Claude Opus 5.5).