summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_io.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_io.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_io.py')
-rw-r--r--Lib/test/test_io.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
index 935e7c9..e499ba2 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -363,8 +363,8 @@ class IOTest(unittest.TestCase):
def test_open_handles_NUL_chars(self):
fn_with_NUL = 'foo\0bar'
- self.assertRaises(TypeError, self.open, fn_with_NUL, 'w')
- self.assertRaises(TypeError, self.open, bytes(fn_with_NUL, 'ascii'), 'w')
+ self.assertRaises(ValueError, self.open, fn_with_NUL, 'w')
+ self.assertRaises(ValueError, self.open, bytes(fn_with_NUL, 'ascii'), 'w')
def test_raw_file_io(self):
with self.open(support.TESTFN, "wb", buffering=0) as f: