◐ Shell
clean mode source ↗

GH-106747: Make pathlib ABC globbing more consistent with `glob.glob()` by barneygale · Pull Request #115056 · python/cpython

….glob()`

When expanding `**` wildcards, ensure we add a trailing slash to the
topmost directory path. This matches `glob.glob()` behaviour:

    >>> glob.glob('dirA/**', recursive=True)
    ['dirA/', 'dirA/dirB', 'dirA/dirB/dirC']

This does not affect `pathlib.Path.glob()`, because trailing slashes aren't
supported in pathlib proper.

fsc-eriker pushed a commit to fsc-eriker/cpython that referenced this pull request

Feb 14, 2024
….glob()` (python#115056)

When expanding `**` wildcards, ensure we add a trailing slash to the
topmost directory path. This matches `glob.glob()` behaviour:

    >>> glob.glob('dirA/**', recursive=True)
    ['dirA/', 'dirA/dirB', 'dirA/dirB/dirC']

This does not affect `pathlib.Path.glob()`, because trailing slashes aren't
supported in pathlib proper.