mirror of
https://github.com/python/cpython.git
synced 2025-08-19 00:00:48 +00:00
Merged revisions 74189 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r74189 | amaury.forgeotdarc | 2009-07-23 21:26:02 +0200 (jeu., 23 juil. 2009) | 4 lines #6553: crash in cPickle.load(), when given a StringIO with incomplete data. Will backport to 2.6, 3.x already fixed a similar issue with issue4298. ........
This commit is contained in:
parent
ce28a01e35
commit
47ccf0cbba
3 changed files with 14 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
import unittest
|
||||
import pickle
|
||||
import cPickle
|
||||
import StringIO
|
||||
import pickletools
|
||||
import copy_reg
|
||||
|
||||
|
@ -1015,6 +1016,10 @@ class AbstractPickleModuleTests(unittest.TestCase):
|
|||
self.module.Pickler(f, -1)
|
||||
self.module.Pickler(f, protocol=-1)
|
||||
|
||||
def test_incomplete_input(self):
|
||||
s = StringIO.StringIO("X''.")
|
||||
self.assertRaises(EOFError, self.module.load, s)
|
||||
|
||||
class AbstractPersistentPicklerTests(unittest.TestCase):
|
||||
|
||||
# This class defines persistent_id() and persistent_load()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue