diff --git a/Lib/test/test_glob.py b/Lib/test/test_glob.py index da73769c16e9af..ff14570588a0e3 100644 --- a/Lib/test/test_glob.py +++ b/Lib/test/test_glob.py @@ -514,6 +514,10 @@ def fn(pat): self.assertEqual(fn('foo/bar\\baz'), r'(?s:foo[/\\]bar[/\\]baz)\Z') self.assertEqual(fn('**/*'), r'(?s:(?:.+[/\\])?[^/\\]+)\Z') + r1 = re.compile(fn('a[%-0]c')) + self.assertEqual(bool(r1.match("a/c")), False) + + if __name__ == "__main__": unittest.main() diff --git a/Misc/NEWS.d/next/Library/2025-03-08-23-26-50.gh-issue-130942.jxRMK_.rst b/Misc/NEWS.d/next/Library/2025-03-08-23-26-50.gh-issue-130942.jxRMK_.rst new file mode 100644 index 00000000000000..2c8906b016ddc7 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2025-03-08-23-26-50.gh-issue-130942.jxRMK_.rst @@ -0,0 +1 @@ +Glob.translate no longer matches path separators in ranges