diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-09-06 17:07:17 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-09-06 17:07:17 (GMT) |
commit | d8a1447c9980be5f1d8ae806f7aecd814b1cd6f6 (patch) | |
tree | a1966e33692ba9de3966c9760957233f51142cb2 /Lib/test/test_fileio.py | |
parent | 4a4b67951570a8a0452c77a5ebaa98b9ef9fb712 (diff) | |
download | cpython-d8a1447c9980be5f1d8ae806f7aecd814b1cd6f6.zip cpython-d8a1447c9980be5f1d8ae806f7aecd814b1cd6f6.tar.gz cpython-d8a1447c9980be5f1d8ae806f7aecd814b1cd6f6.tar.bz2 |
Issue #22215: Now ValueError is raised instead of TypeError when str or bytes
argument contains not permitted null character or byte.
Diffstat (limited to 'Lib/test/test_fileio.py')
-rw-r--r-- | Lib/test/test_fileio.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_fileio.py b/Lib/test/test_fileio.py index b87dc07..41be95e 100644 --- a/Lib/test/test_fileio.py +++ b/Lib/test/test_fileio.py @@ -361,8 +361,8 @@ class OtherFileTests(unittest.TestCase): def testConstructorHandlesNULChars(self): fn_with_NUL = 'foo\0bar' - self.assertRaises(TypeError, _FileIO, fn_with_NUL, 'w') - self.assertRaises(TypeError, _FileIO, bytes(fn_with_NUL, 'ascii'), 'w') + self.assertRaises(ValueError, _FileIO, fn_with_NUL, 'w') + self.assertRaises(ValueError, _FileIO, bytes(fn_with_NUL, 'ascii'), 'w') def testInvalidFd(self): self.assertRaises(ValueError, _FileIO, -10) |