summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_fileio.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-09-06 17:07:17 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-09-06 17:07:17 (GMT)
commitd8a1447c9980be5f1d8ae806f7aecd814b1cd6f6 (patch)
treea1966e33692ba9de3966c9760957233f51142cb2 /Lib/test/test_fileio.py
parent4a4b67951570a8a0452c77a5ebaa98b9ef9fb712 (diff)
downloadcpython-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.py4
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)