Skip to content

Stop dotted sheet names from saving over each other - #9

Merged
Erfouni merged 1 commit into
mainfrom
fix/dotted-sheet-names
Oct 25, 2026
Merged

Erfouni merged 1 commit into
mainfrom
fix/dotted-sheet-names

Conversation

@Erfouni

@Erfouni Erfouni commented Oct 16, 2026

Copy link
Copy Markdown
Owner

Sheets named "Sheet A.1" and "Sheet A.2" both became "Sheet A.dwg", so the second save overwrote the first. A dot is now treated as an extension only when two to four letters follow it. "Sheet A.1" saves to "Sheet A.1.dwg", and plan.exe still saves to plan.dwg. The 52 tests pass, including three new ones.

Limit: a letters-only tail of two to four characters, such as Floor.Plan, can still collide.

_safe_output_path treated everything after the last dot as a file
extension and replaced it. So "Sheet A.1" and "Sheet A.2" were both
saved as "Sheet A.dwg", and the second save overwrote the first.

Now a dot only counts as an extension when two to four ASCII letters
follow it, such as .dwg, .pdf, .exe or .jpeg. Any other tail is kept
and the target extension is added after it, so "Sheet A.1" is saved
as "Sheet A.1.dwg". A real extension is still swapped, so "plan.exe"
requested as a PDF is still "plan.pdf".

Adds regression tests in tests/test_safe_output_path.py.
@Erfouni
Erfouni merged commit cac0867 into main Oct 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant