gh-74033: Fix bug when Path takes and ignores **kwargs by uriyyo · Pull Request #19632 · python/cpython (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation33 Commits13 Checks0 Files changed

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

[ Show hidden characters]({{ revealButtonHref }})

uriyyo

Fix a bug where Path takes and ignores **kwargs by adding to PurePath class __init__ method which can take only positional arguments.

Automerge-Triggered-By: GH:brettcannon

@uriyyo

remilapeyre

Choose a reason for hiding this comment

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

Thanks for writing the fix for this issue Yurii!

@uriyyo

Co-Authored-By: Rémi Lapeyre remi.lapeyre@henki.fr

@uriyyo

remilapeyre

Choose a reason for hiding this comment

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

Thanks!

remilapeyre

Choose a reason for hiding this comment

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

Hi @uriyyo, as I indicated on bpo, PurePath suffers from a similar issue, it and its subclasses cannot accept **kwargs.

Could you make the same changes to PurePath so the behaviour is the same for the whole module?

@uriyyo

@uriyyo

@uriyyo

remilapeyre

Choose a reason for hiding this comment

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

Thanks @uriyyo, I just tested your changes and it looks good to me 👍

I just proposed two small things

@uriyyo

Co-authored-by: Rémi Lapeyre remi.lapeyre@henki.fr

@uriyyo

Co-authored-by: Rémi Lapeyre remi.lapeyre@henki.fr

@uriyyo

@uriyyo uriyyo changed the titlebpo-29847: Fix bug when Path takes and ignores **kwargs bpo-29847: Fix bug when PurePath takes and ignores **kwargs

May 22, 2020

@uriyyo uriyyo changed the titlebpo-29847: Fix bug when PurePath takes and ignores **kwargs bpo-29847: Fix bug when Path takes and ignores **kwargs

May 22, 2020

@iritkatriel

@netlify

@brettcannon brettcannon changed the titlebpo-29847: Fix bug when Path takes and ignores **kwargs gh-74033: Fix bug when Path takes and ignores **kwargs

Dec 16, 2022

brettcannon

Choose a reason for hiding this comment

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

Since "explicit is better than implicit", I think we want pathlib.Path to raise an error with keyword arguments instead of letting PurePath silently accept keyword arguments.

@bedevere-bot

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@uriyyo @brettcannon

Co-authored-by: Brett Cannon brett@python.org

@uriyyo

@uriyyo

I have made the requested changes; please review again

@bedevere-bot

Thanks for making the requested changes!

@brettcannon: please review the changes made to this pull request.

brettcannon

Choose a reason for hiding this comment

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

Unfortunately we need to ask that this raises a warning for at least 2 releases.

@bedevere-bot

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@uriyyo

@uriyyo

I have made the requested changes; please review again.

@bedevere-bot

Thanks for making the requested changes!

@brettcannon: please review the changes made to this pull request.

brettcannon

@brettcannon

@brettcannon

@miss-islington

Status check is done, and it's a success ✅.

@brettcannon

Thanks for the PR and the patience!

@uriyyo uriyyo deleted the fix-issue-29847 branch

January 14, 2023 08:24