Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Towards pathlib.Path.mkdir compatibility #410

Merged
merged 2 commits into from
Oct 16, 2018

Conversation

smheidrich
Copy link
Contributor

This PR aims to make the mkdir method of Plumbum's path classes (local & remote) more compatible with pathlib.Path.mkdir by implementing the arguments parents and exist_ok that are present in the latter. The mode argument has also been added to the argument list to match the signature of pathlib's method and preserve backwards-compatibility once it is implemented in the future, but I haven't implemented it yet, because pathlib does some umask-voodoo that I'd have to look into in more detail. I might add it later.

Should be backwards-compatible with earlier Plumbum mkdir behavior (which unfortunately required choosing defaults different from pathlib's, however) and of course comes with tests.

@coveralls
Copy link

coveralls commented Sep 25, 2018

Coverage Status

Coverage decreased (-0.6%) to 82.492% when pulling e37791c on smheidrich:pathlib_mkdir_compatibility1 into efc2795 on tomerfiliba:master.

@henryiii
Copy link
Collaborator

I'd like pathlib compatibility (I'd love it if someday remotes were just subclassed pathlib paths), but we probably shouldn't make a backward incompatible default change until 1.7.0, for example.

@henryiii henryiii merged commit 361db26 into tomerfiliba:master Oct 16, 2018
@smheidrich
Copy link
Contributor Author

Thanks for merging! 👍

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.

None yet

3 participants