[New-bugs-announce] [issue35488] pathlib Path.match does not behave as described

anthony shaw report at bugs.python.org
Fri Dec 14 01:40:23 EST 2018


New submission from anthony shaw <anthony.p.shaw at gmail.com>:

The documentation for pathlib PurePath.match(needle) says it accepts "glob-style pattern.".

For an absolute path with a recursive pattern (**) it doesn't match correct for more than 1 directory level.

All of the assertions in the attached file should pass.

The issue I've seen is on the attached file. I'm using Python 3.7.1 and have also tested this against Python 3.6.6 with the pathlib module on PyPi.

Absolute path glob'ing with a recursive pattern works as expected:

entries = pathlib.Path('/var').glob('/var/**/*.log')

Once this issue is confirmed, I would be happy to test & contribute a fix

----------
components: Library (Lib)
files: test_pathlib.py
messages: 331782
nosy: anthony shaw
priority: normal
severity: normal
status: open
title: pathlib Path.match does not behave as described
versions: Python 3.7
Added file: https://bugs.python.org/file47996/test_pathlib.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35488>
_______________________________________


More information about the New-bugs-announce mailing list