[issue9276] pickle should support methods

Jean-Paul Calderone report at bugs.python.org
Mon Aug 2 15:52:07 CEST 2010


Jean-Paul Calderone <exarkun at twistedmatrix.com> added the comment:

For example:

exarkun at boson:~$ python
Python 2.6.4 (r264:75706, Dec  7 2009, 18:45:15) 
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> class x(object):
...     def __reduce__(self):
...         import os
...         return os.system, ('echo "Hello from sploitland"',)
... 
>>> import pickle
>>> pickle.loads(pickle.dumps(x()))
Hello from sploitland
0
>>>

----------

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


More information about the Python-bugs-list mailing list