Repository navigation
Conversation
agammann
approved these changes
Nov 1, 2026
agammann
left a comment
There was a problem hiding this comment.
I exercised the Windows and universal cases where trimming exposes reserved names, including custom names that contain edge spaces. The sanitizer now applies the reserved-name handler after that trim while retaining the first validation for custom names; the focused filename tests pass (28 passed). The documentation also states when the second check occurs. This looks good to me.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #70.
On Windows and universal platforms, stripping edge spaces or trailing periods can expose a reserved filename:
sanitize_filename(" AUX")currently returnsAUX. Recheck reserved names after that cleanup and use the existing reserved-name handler for filename and filepath components.Keep the initial validation so custom names containing edge spaces, such as
additional_reserved_names=[" CUSTOM"], still match and invoke their handler. Earlier fixes in #72, #73 and #74 were closed without merging; this replacement covers the compatibility case raised on #74 while retaining the existing handler behavior.Tests cover exposed reserved names, extensions, str/Path inputs, path components, custom names with edge spaces, handler behavior and Linux controls. API docstrings describe the matching order.
Validation on macOS arm64 / CPython 3.9.6:
The cross-platform interpreter matrix has not been run locally.