File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -458,6 +458,12 @@ def test_translate_matching(self):
458458 self .assertIsNone (match (os .path .join ('foo' , '.bar.txt' )))
459459 match = re .compile (glob .translate ('foo[%-0]bar' , recursive = True )).match
460460 self .assertIsNone (match (os .path .join ('foo' , 'bar' )))
461+ match = re .compile (glob .translate ('foo?bar' , recursive = True )).match
462+ self .assertIsNone (match ('foo/bar' ))
463+ match = re .compile (glob .translate ('foo.' , recursive = True )).match
464+ self .assertIsNone (match ('foo/' ))
465+ match = re .compile (glob .translate ('foo*' , recursive = True )).match
466+ self .assertIsNone (match ('foo/' ))
461467
462468 def test_translate (self ):
463469 def fn (pat ):
Original file line number Diff line number Diff line change 44 lookahead (``(?!/) ``) or by not including the path separator (``^/ ``). In addition,
55 ranges including path separator literals are now correctly escaped, as specified by
66 POSIX specifications.
7-
87.. versionchanged :: next
98 :func: `fnmatch.translate ` does not treat path separator characters as having any
109 special meaning at all, so it still matches ranges implicitly containing path
You can’t perform that action at this time.
0 commit comments