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

GH-113528: Slightly improve pathlib.Path.glob() tests for symlink loop handling #113763

Merged
merged 1 commit into from Jan 6, 2024

Conversation

barneygale
Copy link
Contributor

@barneygale barneygale commented Jan 6, 2024

When filtering results, ignore paths with more than one linkD/ segment, rather than all paths below the first linkD/ segment. This allows us to test that other paths under linkD/ are correctly returned by glob().

For reference, the directory structure used in the pathlib tests looks like:

(root)
 |
 |-- brokenLink -> non-existing
 |-- dirA
 |   `-- linkC -> ../dirB
 |-- dirB
 |   |-- fileB
 |   `-- linkD -> ../dirB
 |-- dirC
 |   |-- dirD
 |   |   `-- fileD
 |   `-- fileC
 |   `-- novel.txt
 |-- dirE  # No permissions
 |-- fileA
 |-- linkA -> fileA
 |-- linkB -> dirB
 `-- brokenLinkLoop -> brokenLinkLoop

When filtering results, ignore paths with more than one `linkD/` segment,
rather than all paths below the first `linkD/` segment. This allows us
to test that other paths under `linkD/` are correctly returned.
@barneygale barneygale changed the title Slightly improve pathlib.Path.glob() tests for symlink loop handling GH-113528: Slightly improve pathlib.Path.glob() tests for symlink loop handling Jan 6, 2024
@bedevere-app bedevere-app bot mentioned this pull request Jan 6, 2024
@barneygale barneygale merged commit 2205510 into python:main Jan 6, 2024
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news tests Tests in the Lib/test dir topic-pathlib
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant