Message225914
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. |
|
Date |
User |
Action |
Args |
2014-08-26 11:37:22 | joca.bt | set | recipients:
+ joca.bt |
2014-08-26 11:37:22 | joca.bt | set | messageid: <1409053042.7.0.771163532868.issue22276@psf.upfronthosting.co.za> |
2014-08-26 11:37:22 | joca.bt | link | issue22276 messages |
2014-08-26 11:37:22 | joca.bt | create | |
|