Skip to content

fix: filename generation with pathlib.stem instead of hardcoded [:-4]#273

Open
ishansurdi wants to merge 1 commit intofireform-core:mainfrom
ishansurdi:fix/pdf-extension-bug
Open

fix: filename generation with pathlib.stem instead of hardcoded [:-4]#273
ishansurdi wants to merge 1 commit intofireform-core:mainfrom
ishansurdi:fix/pdf-extension-bug

Conversation

@ishansurdi
Copy link

Fixes #247

Changed the filename generation in src/filler.py to use Path().stem instead of slicing off the last 4 characters with [:-4].

The old approach broke with files like document.pdf.backup or contract_2024 (no extension). Now it properly handles any filename pattern and prevents name collisions.

Works correctly now whether you're processing .pdf, .pdf.backup, or files without extensions.

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.

[BUG]: Hard-coded extension assumption breaks filename generation

1 participant