diff options
author | Zackery Spytz <zspytz@gmail.com> | 2022-11-28 10:46:40 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-28 10:46:40 (GMT) |
commit | 53eef27133c1da395b3b4d7ce0ab1d5b743ffb41 (patch) | |
tree | 4549e5244c14603b79f0da28db8e1d8220796dfb /Lib/test/test_io.py | |
parent | 492dc02b01828f346dd62412fefc654e781de923 (diff) | |
download | cpython-53eef27133c1da395b3b4d7ce0ab1d5b743ffb41.zip cpython-53eef27133c1da395b3b4d7ce0ab1d5b743ffb41.tar.gz cpython-53eef27133c1da395b3b4d7ce0ab1d5b743ffb41.tar.bz2 |
bpo-31718: Fix io.IncrementalNewlineDecoder SystemErrors and segfaults (#18640)
Co-authored-by: Oren Milman <orenmn@gmail.com>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Diffstat (limited to 'Lib/test/test_io.py')
-rw-r--r-- | Lib/test/test_io.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index c927f15..c5f2e50 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -3945,7 +3945,15 @@ class IncrementalNewlineDecoderTest(unittest.TestCase): self.assertEqual(decoder.decode(b"\r\r\n"), "\r\r\n") class CIncrementalNewlineDecoderTest(IncrementalNewlineDecoderTest): - pass + @support.cpython_only + def test_uninitialized(self): + uninitialized = self.IncrementalNewlineDecoder.__new__( + self.IncrementalNewlineDecoder) + self.assertRaises(ValueError, uninitialized.decode, b'bar') + self.assertRaises(ValueError, uninitialized.getstate) + self.assertRaises(ValueError, uninitialized.setstate, (b'foo', 0)) + self.assertRaises(ValueError, uninitialized.reset) + class PyIncrementalNewlineDecoderTest(IncrementalNewlineDecoderTest): pass |