Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

bpo-39906: add follow_symlinks parameter to pathlib.Path.stat() and chmod()#18864

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

Already on GitHub?Sign in to your account

Conversation

barneygale
Copy link
Contributor

@barneygalebarneygale commentedMar 9, 2020
edited by bedevere-bot
Loading

Backwards-compatible change that makes this work:

importpathlibp=pathlib.Path("/some/symlink")assertp.stat(follow_symlinks=True)==p.stat()assertp.stat(follow_symlinks=False)==p.lstat()

This brings pathlib in line with the newishfollow_symlinks parameters inos functions, and arguably provides a more explicit (and nicer?) interface.

For consistency I've applied the same change tochmod(), though as far as I can tell, changing permissions on symlinks is only available on some BSDs (seebpo-7479)

https://bugs.python.org/issue39906

russelldavis reacted with thumbs up emoji
@the-knights-who-say-ni

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed thePSF contributor agreement (CLA).

CLA Missing

Our records indicate the following people have not signed the CLA:

@barneygale

For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please followthe steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You cancheck yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@barneygalebarneygaleforce-pushed thebpo-39906-pathlib-path-follow-symlinks branch froma0720ed to3ede281CompareMarch 10, 2020 20:52
@barneygalebarneygaleforce-pushed thebpo-39906-pathlib-path-follow-symlinks branch 2 times, most recently from7782e14 to7f5854aCompareMarch 30, 2020 01:25
pitrou
pitrou previously requested changesApr 17, 2020
Copy link
Member

@pitroupitrou left a comment

Choose a reason for hiding this comment

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

The addition looks good on the principle. Two comments though. Also, you'll need to rebase / merge from master.

@bedevere-bot
Copy link

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 phraseI 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.

@csabella
Copy link
Contributor

@barneygale, please address the review comments. Thank you!

@barneygalebarneygaleforce-pushed thebpo-39906-pathlib-path-follow-symlinks branch from7f5854a toe9b6598CompareMay 29, 2020 01:09
@barneygale
Copy link
ContributorAuthor

Rebased + docs versions fixed

@barneygale
Copy link
ContributorAuthor

I have made the requested changes; please review again

@bedevere-bot
Copy link

Thanks for making the requested changes!

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

@bedevere-botbedevere-bot requested a review frompitrouMay 29, 2020 01:19
@russelldavis
Copy link
Contributor

This is great, thanks. Not sure whether it's out of scope for this PR, but it might also be nice to add thefollow_symlinks param to some of the methods that callstat() internally, in particularis_file() andis_dir() (this would be consistent with those same methods onos.DirEntry).

barneygale reacted with thumbs up emoji

@barneygalebarneygaleforce-pushed thebpo-39906-pathlib-path-follow-symlinks branch frome9b6598 to2cc9f3bCompareJanuary 21, 2021 23:37
@barneygale
Copy link
ContributorAuthor

@pitrou bumping this one! Think it's ready for review if you have the time

Copy link
Member

@zoobazooba left a comment

Choose a reason for hiding this comment

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

Sorry for the slow reviews. This looks fine to me, except it'll land in 3.10, and so the docs need to be updated to reflect that.

@barneygalebarneygaleforce-pushed thebpo-39906-pathlib-path-follow-symlinks branch from2cc9f3b to163742dCompareApril 7, 2021 01:05
@barneygale
Copy link
ContributorAuthor

Thanks for the review - I've updated the.. versionchanged bits.

@zoobazooba dismissedpitrou’sstale reviewApril 7, 2021 15:51

Changes have been made

@zooba
Copy link
Member

Just an FYI@barneygale, we squash merge at the end, so there's no need to rebase and force push PRs (merging and regular push is fine). All it does is break the review history.

@zoobazooba merged commitabf9649 intopython:masterApr 7, 2021
@barneygale
Copy link
ContributorAuthor

Just an FYI@barneygale, we squash merge at the end, so there's no need to rebase and force push PRs (merging and regular push is fine). All it does is break the review history.

Good to know, thank you.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@zoobazoobazooba left review comments

@pitroupitrouAwaiting requested review from pitrou

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

7 participants
@barneygale@the-knights-who-say-ni@bedevere-bot@csabella@russelldavis@zooba@pitrou

[8]ページ先頭

©2009-2025 Movatter.jp