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
Is this similar to (See also ) and ? As I can see in Lib/test/test_pathlib.py there are also no tests for "**" and I think it's good to add one along with documenting it.
Yes, this is similar to https://bugs.python.org/issue29249 In that issue, it suggests this feature is not supported, but that is neither documented, nor tested.