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

Change Path.makedirs() -> Path.mkdir(parents=True) #6701

Merged
merged 1 commit into from Jul 13, 2019

Conversation

pradyunsg
Copy link
Member

@pradyunsg pradyunsg commented Jul 12, 2019

Toward #6050.

@pradyunsg pradyunsg added C: tests Testing and related things skip news Does not need a NEWS file entry (eg: trivial changes) labels Jul 12, 2019
@pradyunsg pradyunsg mentioned this pull request Jul 12, 2019
@pradyunsg pradyunsg added the type: refactor Refactoring code label Jul 12, 2019
@xavfernandez
Copy link
Member

needs exist_ok parameter instead of assuming it is OK

This only needs to be added to tests that would fail on directly switching this behavior.

And, in those cases, I feel we should blanket-replace path.mkdir with assert path.exists() anyway.

Since the goal is to replace tests.lib.path by Pathlib (or equivalent), I think it should behave identically. And since exist_ok defaults to False, mkdir should raise and not return self...

@pradyunsg
Copy link
Member Author

I want us to tackle that in a follow up on that. We can make that change too, bringing it in line with pathlib's Path.

Right now, this PR is scoped to just getting rid of makedirs though. 🙃

Copy link
Member

@xavfernandez xavfernandez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If an other PR adds exist_ok, this one is fine 🙂

@pradyunsg pradyunsg merged commit 34621bf into pypa:master Jul 13, 2019
@pradyunsg pradyunsg deleted the tests/remove-makedirs branch July 13, 2019 11:23
@chrahunt
Copy link
Member

chrahunt commented Jul 13, 2019

Adding exist_ok is tracked in the note for mkdir here.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Aug 12, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation C: tests Testing and related things skip news Does not need a NEWS file entry (eg: trivial changes) type: refactor Refactoring code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants