mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Patch #1535500: fix segfault in BZ2File.writelines and make sure it
raises the correct exceptions.
This commit is contained in:
parent
2463f8f831
commit
3335a7ad63
3 changed files with 22 additions and 2 deletions
|
|
@ -166,6 +166,8 @@ class BZ2FileTest(BaseTest):
|
|||
sio = StringIO(self.TEXT)
|
||||
bz2f.writelines(sio.readlines())
|
||||
bz2f.close()
|
||||
# patch #1535500
|
||||
self.assertRaises(ValueError, bz2f.writelines, ["a"])
|
||||
f = open(self.filename, 'rb')
|
||||
self.assertEqual(self.decompress(f.read()), self.TEXT)
|
||||
f.close()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue