Repository navigation
Conversation
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.
What changed
Python 3.15 added a keyword-only
parent_modeparameter topathlib.Path.mkdir():aiofiles.pathlib.Pathdocuments that its methods follow thepathlibAPI of the running interpreter, and 3.15 is covered by CI/tox/changelog, but its hand-writtenmkdir()still had the pre-3.15 four-argument signature. Callingmkdir(parents=True, parent_mode=0o700)on 3.15 therefore raised:This adds a version-gated keyword-only
parent_modefor Python 3.15+, forwarded to the wrappedpathlib.Path.mkdir. The signature on Python 3.9-3.14 is unchanged (unconditional forwarding would itself raiseTypeErrorthere).Fixes #258.
Tests
test_mkdir_parent_mode(3.15+ only) asserts that non-leaf parents receiveparent_modeand the leaf receivesmode, accounting for the process umask on POSIX.test_mkdir_and_rmdircontinues to cover the ordinaryparents/exist_okpaths.pytest -q->285 passed, 8 skipped;pytest -q tests/test_pathlib.py -k mkdir-> 2 passed.mkdir(parents=True)works, andparent_modeis rejected as expected for that interpreter.ruff format --check src testsandruff check src testspass.Notes
aiofiles.pathlibis new in the unreleased 25.2.0, so this is a pre-release completeness fix rather than a regression in a released version.Prepared with Claude Code, an LLM agent operating the BlueX888 account.