Skip to content

gh-117201: Handle leading // for posixpath.commonpath #117202

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

Closed
wants to merge 14 commits into from

Conversation

nineteendo
Copy link
Contributor

@nineteendo nineteendo commented Mar 24, 2024

Tracked further here:

@bedevere-app
Copy link

bedevere-app bot commented Mar 24, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@nineteendo
Copy link
Contributor Author

nineteendo commented Mar 24, 2024

Hmm, looks like None should raise a TypeError and not a ValueError. That was unexpected.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@bedevere-app
Copy link

bedevere-app bot commented Mar 24, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

Copy link
Contributor

@barneygale barneygale left a comment

Choose a reason for hiding this comment

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

Very tidy implementation! I'm particularly pleased you removed this head-scratcher:

isabs, = set(p[:1] == sep for p in paths)

Could you add a news blurb?

@bedevere-app
Copy link

bedevere-app bot commented Mar 26, 2024

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.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@nineteendo
Copy link
Contributor Author

Barneygale, I have made the requested changes; please review again.

@bedevere-app
Copy link

bedevere-app bot commented Mar 26, 2024

Thanks for making the requested changes!

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

@bedevere-app bedevere-app bot requested a review from barneygale March 26, 2024 20:24
@nineteendo nineteendo marked this pull request as draft March 26, 2024 20:42
@nineteendo nineteendo marked this pull request as ready for review March 26, 2024 21:12
@nineteendo
Copy link
Contributor Author

Eh, there seems to be a bug with @bedevere-app:

  • I converted this issue to a draft & back
  • bedevere-app added "awaiting review" & removed "awaiting change review".

Not entirely sure where to report that...

@nineteendo nineteendo marked this pull request as draft March 28, 2024 07:43
@nineteendo nineteendo marked this pull request as ready for review March 28, 2024 10:14
@nineteendo nineteendo marked this pull request as draft March 28, 2024 14:36
@barneygale
Copy link
Contributor

Don't worry about making commonpath() a little slower if you're fixing a bug, that's no problem. You don't need to compensate for it by speeding up other methods! Those speed-ups look nice, but I think they might be easier to review in their own PR, if that's no trouble? Thanks!

@nineteendo
Copy link
Contributor Author

I was simply refactoring the other functions to make them more readable, while waiting for suggestions.
But, must I put the bug fixes for ntpath.commonpath & posixpath.realpath (coming up) in separate pull requests?

@barneygale
Copy link
Contributor

Yes please, separate PRs for separate changes makes each one easier to review.

Note that we don't accept changes that only improve readability. It causes too much churn and too many arguments. But you're welcome to improve readability as part of another change, e.g. a bugfix, enhancement or speed-up, as long as you're not introducing too much risk by tinkering with delicate code. Hope that makes sense?

@nineteendo nineteendo closed this Mar 28, 2024
@nineteendo nineteendo deleted the fix-commonpath branch March 28, 2024 18:39
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

2 participants