New submission from João Guerra:
Both fnmatch and glob support the "*/" glob. However, pathlib does not seem to
handle this kind of globs correctly.
dir = Path("/a/directory/")
file = Path("/a/file")
print(dir.match("*/")) # True
print(file.match("*/")) # True
The "/" is being discarded by the match, resulting in incorrect matches.
Both the fnmatch and glob libraries support this correct.
print(fnmatch("/a/directory/", "*/")) # True
print(fnmatch("/a/file", "*/")) # False
Issue 21039 may be related to this.
----------
components: Library (Lib)
messages: 225914
nosy: joca.bt
priority: normal
severity: normal
status: open
title: pathlib glob issues
type: behavior
versions: Python 3.4
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue22276>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com