Repository navigation
Add pathlib-compatible special-file predicates - #275
Open
polootyyyyy wants to merge 3 commits into
Open
polootyyyyy wants to merge 3 commits into
polootyyyyy wants to merge 3 commits into
Conversation
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.
Adds
Path.is_fifo(),Path.is_socket(),Path.is_block_device()andPath.is_char_device(), each delegating to the correspondingpathlib.Pathmethod. This covers those four pending items in #214 and preserves the running standard library's predicate behavior. Includes a release note.Regression tests cover real FIFOs, Unix-domain sockets, symlink targets, character devices, ordinary files and directories, missing paths, broken links and regular-file parents. Block-device classification uses a controlled stat result without requiring privileged device creation.
Validation on Linux arm64 with Python 3.12.15: all 44 focused cases fail with missing-method errors on unchanged upstream and pass with the additions. Full tox passes (208 passed, 1 skipped), including Ruff and mypy; the strict documentation build and sphinxlint also pass. The source archive used
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PATH=17.1.1, passed through tox's test and packaging environments. Native macOS and Windows were not run locally.Refs #214; this does not close the broader compatibility checklist.