Skip to content

Extract filename extensions from the basename - #154

Open
Ychris12138 wants to merge 1 commit into
cdgriffith:masterfrom
Ychris12138:fix/filename-extension-basename
Open

Ychris12138 wants to merge 1 commit into
cdgriffith:masterfrom
Ychris12138:fix/filename-extension-basename

Conversation

@Ychris12138

Copy link
Copy Markdown

ext_from_filename("directory.with.dots/README") currently returns ".dots/readme", treating part of the parent directory as the file extension. from_file() and the filename-hint APIs all use this helper.

Take the basename before splitting the extension. Add eight cases for str and Path inputs to verify extensionless names, case normalization, recognized double extensions, and existing dotfile behavior inside dotted directories.

Validation on Python 3.12: 103 tests passed (the two extensionless-path cases fail before the fix); Ruff check/format and git diff --check passed. The test suite rewrites its CRLF text fixture; that generated change was restored and is not part of this PR.

AI-assisted implementation; all reported checks were executed locally.

Copilot AI balanced review requested due to automatic review settings October 9, 2026 03:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

2 participants