sbt <[email protected]> added the comment:
Buffer objects *are* picklable with protocol 2 (but not with earlier
protocols). Unfortunately, the result is not unpicklable.
This is not a problem with multiprocessing. (buffer seems to inherit
__reduce__ and __reduce_ex__ from object.)
Python 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53)
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cPickle
>>> cPickle.dumps(buffer("hello"), cPickle.HIGHEST_PROTOCOL)
'\x80\x02c__builtin__\nbuffer\nq\x01)\x81q\x02.'
>>> cPickle.loads(_)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: buffer() takes at least 1 argument (0 given)
----------
nosy: +sbt
title: multiprocessing.Queue ignores pickle restrictions in .put() -> buffer
objects are picklable but result is not unpicklable
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue8323>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com