GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GH-89769: Pathlib - do not follow links when checking for precise glob match by akulakov · Pull Request #29655 · python/cpython

Conversation

@akulakov

@akulakov akulakov commented Nov 20, 2021 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

https://bugs.python.org/issue45606

I've also added a follow_symlinks arg to exists() method because it seems more logical to be able to test if a path exists via the same method rather than having to also remember and to check for it being a symlink. This is also consistent with a few other Path methods; and it makes it more explicit and clearer that by default exists() follows symlinks, by looking at its signature (otherwise this may be a surprising behaviour).

  • Issue: pathlib.Path.glob() does not list dangling symlink when pattern is the exact filename #89769

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@akulakov
do not follow links when checking for precise glob match
272c1b4
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Nov 20, 2021
@bedevere-bot bedevere-bot added the awaiting review label Nov 20, 2021
akulakov added 6 commits November 19, 2021 23:22
@akulakov
update docs for exists()
70db4c0
@akulakov
add news entry
cf0f823
@akulakov
add docstring; fix the doctest error in the documentation
9107f3d
@akulakov
expand test_exists
4c40ea3
@akulakov
fix typo in var name
686cd34
@akulakov
revert typo fix
01ec5af
ambv
ambv reviewed Nov 20, 2021
View reviewed changes
Comment thread Lib/test/test_pathlib.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@akulakov
move symlink tests to conditional
1d03f90
@github-actions

github-actions Bot commented Dec 21, 2021

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Dec 21, 2021
MaxwellDupre
MaxwellDupre approved these changes Mar 1, 2022
View reviewed changes

@MaxwellDupre MaxwellDupre left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Works on my Ubuntu and I see bot tests are ok, so ok with me.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-bot bedevere-bot added awaiting core review and removed awaiting review labels Mar 1, 2022
@raek raek mannequin mentioned this pull request Apr 10, 2022
pathlib.Path.glob() does not list dangling symlink when pattern is the exact filename #89769
Closed
@brettcannon brettcannon added the topic-pathlib label Jun 21, 2022
@ezio-melotti ezio-melotti removed the CLA signed label Jul 13, 2022
barneygale
barneygale requested changes May 2, 2023
View reviewed changes

@barneygale barneygale left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Change looks good! Could you fix conflicts please?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/library/pathlib.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/pathlib.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/pathlib.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/pathlib.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Misc/NEWS.d/next/Library/2021-11-19-23-37-18.bpo-45606.UW5XE1.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the awaiting core review label May 2, 2023
@bedevere-bot

bedevere-bot commented May 2, 2023

Copy link
Copy Markdown

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added the awaiting changes label May 2, 2023
@barneygale barneygale changed the title bpo-45606: Pathlib - do not follow links when checking for precise glob match GH-89769: Pathlib - do not follow links when checking for precise glob match May 2, 2023
akulakov and others added 5 commits May 2, 2023 21:53
@akulakov @barneygale
Update Lib/pathlib.py
66700bf
Co-authored-by: Barney Gale <[email protected]>
@akulakov @barneygale
Update Doc/library/pathlib.rst
0e07f88
Co-authored-by: Barney Gale <[email protected]>
@akulakov @barneygale
Update Lib/pathlib.py
071f0f3
Co-authored-by: Barney Gale <[email protected]>
@akulakov @barneygale
Update Misc/NEWS.d/next/Library/2021-11-19-23-37-18.bpo-45606.UW5XE1.rst
6cff634
Co-authored-by: Barney Gale <[email protected]>
@akulakov
update docstring
3818c31
barneygale
barneygale approved these changes May 3, 2023
View reviewed changes

@barneygale barneygale left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Last nit. Thanks!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/library/pathlib.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added awaiting merge and removed awaiting changes labels May 3, 2023
barneygale and others added 2 commits May 3, 2023 03:29
@barneygale
Merge branch 'main' into 45606-Path-glob-no-follow-symlink
4b6fefc
@akulakov @barneygale
Update Doc/library/pathlib.rst
0093d52
Co-authored-by: Barney Gale <[email protected]>
@barneygale barneygale removed the stale Stale PR or inactive for long period of time. label May 3, 2023
@barneygale
barneygale merged commit af886ff into python:main May 3, 2023
@bedevere-bot bedevere-bot removed the awaiting merge label May 3, 2023
@barneygale

barneygale commented May 3, 2023

Copy link
Copy Markdown
Contributor

Thanks again, @akulakov

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@akulakov

akulakov commented May 3, 2023

Copy link
Copy Markdown
Contributor Author

Thanks @barneygale for the review and merging!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland erlend-aasland mentioned this pull request May 3, 2023
gh-104146: Remove unused 'second_pass_replacements' from clinic.py #104147
Merged
@barneygale barneygale mentioned this pull request Jun 14, 2023
Support for not following symlinks in pathlib.Path.is_dir() #105793
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ambv ambv ambv left review comments
@barneygale barneygale barneygale approved these changes
+1 more reviewer
@MaxwellDupre MaxwellDupre MaxwellDupre approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

topic-pathlib

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

8 participants

@akulakov @bedevere-bot @barneygale @ambv @MaxwellDupre @brettcannon @the-knights-who-say-ni @ezio-melotti
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.