[PR #1835] leonida_mods: install accepts the file names pack writes (MODS-PACKAGE-FILE-NAMES) #1846

Open
opened 2026-11-26 21:19:10 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1835
Author: @RK28A
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: mods-package-file-names


📝 Commits (1)

  • 58f14c3 leonida_mods: install accepts the file names pack writes

📊 Changes

3 files changed (+132 additions, -4 deletions)

View changed files

📝 docs/modding.md (+3 -1)
➕ tests/test_mod_package_names.py (+107 -0)
📝 tools/leonida_mods.py (+22 -3)

📄 Description

Claimed in the coordination issue as: MODS-PACKAGE-FILE-NAMES

What and why

install checked each file name of a package against safe_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 like read me.txt or a name longer than 80 characters was packed by pack and then refused by install as 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. pack runs the same check before it writes so it never writes a package that install refuses.

Tested

python -I tests/test_mod_package_names.py passes with 5 tests and all 5 fail without the change. tests/test_leonida_mods.py and tests/test_mod_pack_output_alias.py still 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

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of 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.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1835 **Author:** [@RK28A](https://github.com/RK28A) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `mods-package-file-names` --- ### 📝 Commits (1) - [`58f14c3`](https://github.com/ubiquitarianism/leonida/commit/58f14c3d68abcc0cca70d4f10965dae313988b6b) leonida_mods: install accepts the file names pack writes ### 📊 Changes **3 files changed** (+132 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `docs/modding.md` (+3 -1) ➕ `tests/test_mod_package_names.py` (+107 -0) 📝 `tools/leonida_mods.py` (+22 -3) </details> ### 📄 Description Claimed in the coordination issue as: MODS-PACKAGE-FILE-NAMES ### What and why `install` checked each file name of a package against `safe_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 like `read me.txt` or a name longer than 80 characters was packed by `pack` and then refused by `install` as 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. `pack` runs the same check before it writes so it never writes a package that `install` refuses. ### Tested `python -I tests/test_mod_package_names.py` passes with 5 tests and all 5 fail without the change. `tests/test_leonida_mods.py` and `tests/test_mod_pack_output_alias.py` still 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 - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#1846
No description provided.