Skip to content

Conversation

barneygale
Copy link
Contributor

@barneygale barneygale commented Feb 8, 2025

In the private pathlib ABCs, make ReadablePath.glob('') yield a path with a trailing slash (if it yields anything at all). As a result, glob() works similarly to joinpath() when given a non-magic pattern.

In the globbing implementation, we preemptively add trailing slashes to intermediate paths if there are pattern parts remaining; this removes the need to check for existing trailing slashes (in the removed add_slash() method) at subsequent steps.

…ob('')`

In the private pathlib ABCs, make `ReadablePath.glob('')` yield a path with
a trailing slash (if it yields anything at all). As a result, `glob()`
works similarly to `joinpath()` when given a non-magic pattern.

In the globbing implementation, we preemptively add trailing slashes to
intermediate paths if there are pattern parts remaining; this removes the
need to check for existing trailing slashes (in the removed `add_slash()`
method) at subsequent steps.
@barneygale barneygale merged commit 707d066 into python:main Feb 8, 2025
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant