Skip to content

pathlib ABCs: ReadablePath.glob('') doesn't add trailing slash #129835

Closed
@barneygale

Description

@barneygale

Bug report

Minor issue in some still-private code.

In the pathlib ABCs, ReadablePath.glob('') should work a bit like JoinablePath.joinpath(''), i.e. it should yield the path with a trailing slash if it's an existing directory. This isn't presently the case, because the globbing implementation tries to defer adding trailing slashes, for basically no good reason.

Most easily reproduced by running DummyReadablePathTest.test_glob_empty_pattern(), which currently asserts the wrong result (!)

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions