Author ppperry
Recipients ppperry
Date 2014-07-16.00:13:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1405469623.84.0.281722062447.issue21986@psf.upfronthosting.co.za>
In-reply-to
Content
In IDLE:

>>> code = compile("dummy_code", "<test>", "exec")
>>> pickle.dumps(code)
"cidlelib.rpc\nunpickle_code\np0\n(S'c\\x00\\x00\\x00\\x00\\x00\\x00 \\x00\\x00\\x01\\x00\\x00\\x00@\\x00\\x00\\x00s\\x08\\x00\\x00\\x00e\\x00\\x00\\x01d\\x00\\x00S(\\x01\\x00\\x00\\x00N(\\x01\\x00\\x00\\x00t\\n\\x00\\x00\\x00dummy_code(\\x00\\x00\\x00\\x00(\\x00\\x00\\x00\\x00(\\x00\\x00\\x00\\x00s\\x06\\x00\\x00\\x00<test>t\\x08\\x00\\x00\\x00<module>\\x01\\x00\\x00\\x00s\\x00\\x00\\x00\\x00'\np1\ntp2\nRp3\n."


Outside of IDLE:
>>> code = compile("dummy_code", "<test>", "exec")
>>> pickle.dumps(code)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\pickle.py", line 1374, in dumps
    Pickler(file, protocol).dump(obj)
  File "C:\Python27\lib\pickle.py", line 224, in dump
    self.save(obj)
  File "C:\Python27\lib\pickle.py", line 306, in save
    rv = reduce(self.proto)
  File "C:\Python27\lib\copy_reg.py", line 70, in _reduce_ex
    raise TypeError, "can't pickle %s objects" % base.__name__
TypeError: can't pickle code objects



Also, the error probably should be a pickle.PicklingError, not a TypeError.
History
Date User Action Args
2014-07-16 00:13:44ppperrysetrecipients: + ppperry
2014-07-16 00:13:43ppperrysetmessageid: <1405469623.84.0.281722062447.issue21986@psf.upfronthosting.co.za>
2014-07-16 00:13:43ppperrylinkissue21986 messages
2014-07-16 00:13:43ppperrycreate