[New-bugs-announce] [issue5345] cStringIO class name typo

qwjqwj report at bugs.python.org
Sun Feb 22 08:09:37 CET 2009


New submission from qwjqwj <qwj at papayamobile.com>:

It has a typo error in cStringIO.StringIO's class name "StringO":

>>> import cStringIO
>>> a=cStringIO.StringIO()
>>> a
<cStringIO.StringO object at 0xb7eef240>
>>> a.__class__.__name__
'StringO'

So we can't unpickle the object correctly with Python 2.5.4:

>>> import pickle
>>> pickle.loads(pickle.dumps(a))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.5/pickle.py", line 1366, in dumps
    Pickler(file, protocol).dump(obj)
  File "/usr/local/lib/python2.5/pickle.py", line 224, in dump
    self.save(obj)
  File "/usr/local/lib/python2.5/pickle.py", line 306, in save
    rv = reduce(self.proto)
  File "/usr/local/lib/python2.5/copy_reg.py", line 69, in _reduce_ex
    raise TypeError, "can't pickle %s objects" % base.__name__
TypeError: can't pickle StringO objects


When using multiprocess library, it also use the pickling and unpickling
of cStringIO.StringIO object

----------
components: Library (Lib)
messages: 82595
nosy: qwjqwj
severity: normal
status: open
title: cStringIO class name typo
versions: Python 2.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5345>
_______________________________________


More information about the New-bugs-announce mailing list