Skip to content

Conversation

barneygale
Copy link
Contributor

@barneygale barneygale commented Sep 20, 2025

Add mode() method to the PathInfo protocol. A concrete implementation is available via Path.info.mode(). This method caches and returns the Posix file permissions, i.e. st_mode from the stat struct with its file format bits masked out.

In the tests for the pathlib ABCs, add mode() methods to our ZipPathInfo and LocalPathInfo classes, and test them from test_read.


📚 Documentation preview 📚: https://cpython-previews--139183.org.readthedocs.build/

Add `mode()` method to the `PathInfo` protocol. A concrete implementation
is available via `Path.info.mode()`. This method caches and returns the
Posix file permissions, i.e. `st_mode` from the stat struct with its file
format bits masked out.

In the tests for the pathlib ABCs, add `mode()` methods to our
`ZipPathInfo` and `LocalPathInfo` classes, and test them from `test_read`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant