mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
Issue #3187: Better support for "undecodable" filenames. Code by Victor
Stinner, with small tweaks by GvR.
This commit is contained in:
parent
fefeca53ee
commit
f0af3e30db
11 changed files with 359 additions and 145 deletions
|
|
@ -37,6 +37,15 @@ class FnmatchTestCase(unittest.TestCase):
|
|||
check('a', r'[!\]')
|
||||
check('\\', r'[!\]', 0)
|
||||
|
||||
def test_mix_bytes_str(self):
|
||||
self.assertRaises(TypeError, fnmatch, 'test', b'*')
|
||||
self.assertRaises(TypeError, fnmatch, b'test', '*')
|
||||
self.assertRaises(TypeError, fnmatchcase, 'test', b'*')
|
||||
self.assertRaises(TypeError, fnmatchcase, b'test', '*')
|
||||
|
||||
def test_bytes(self):
|
||||
self.check_match(b'test', b'te*')
|
||||
self.check_match(b'test\xff', b'te*\xff')
|
||||
|
||||
def test_main():
|
||||
support.run_unittest(FnmatchTestCase)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue