Author Claudiu.Popa
Recipients Claudiu.Popa, kbk, loewis, pitrou, ppperry, roger.serwy, serhiy.storchaka, terry.reedy
Date 2014-10-09.21:28:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Thank you for your feedback, Terry.

1. IDLE is behaving differently than the builtin interpreter. It should be higher priority, because it
leads beginners into believing that code objects are picklable.

2. No, wrapping code objects in a CodePickler with __getstate__ et al will not work. What is important in my implementation of CodePickler is that the dispatch_table is private, so it will not leak private reduction function, as it happens right now.

3. That doesn't make sense. What works now is pickling of code objects, removing the copyreg call, without my patch, will break the rpc as well. To test this, comment the copyreg.pickle call in idlelib.rpc and just define a function in IDLE, you'll get a PicklingError. I added a small test file, which can be used to test what happens now and what happens after my patch.

4. Better, here's a traceback which can explain from where codes are sent. The traceback is from inside pickle_code, using code.InteractiveInterpreter.

 File "C:\Python34\lib\idlelib\", line 1602, in main
 File "C:\Python34\lib\tkinter\", line 1069, in mainloop
 File "C:\Python34\lib\tkinter\", line 1487, in __call__
   return self.func(*args)
 File "C:\Python34\lib\idlelib\", line 179, in handler
   r = l[i](event)
 File "C:\Python34\lib\idlelib\", line 1188, in enter_callback
 File "C:\Python34\lib\idlelib\", line 1229, in runit
   more = self.interp.runsource(line)
 File "C:\Python34\lib\idlelib\", line 671, in runsource
   return InteractiveInterpreter.runsource(self, source, filename)
 File "C:\Python34\lib\", line 74, in runsource
 File "C:\Python34\lib\idlelib\", line 762, in runcode
   (code,), {})
 File "C:\Python34\lib\idlelib\", line 256, in asyncqueue
   self.putmessage((seq, request))
 File "C:\Python34\lib\idlelib\", line 348, in putmessage
   s = pickle.dumps(message)
Date User Action Args
2014-10-09 21:28:26Claudiu.Popasetrecipients: + Claudiu.Popa, loewis, terry.reedy, kbk, pitrou, roger.serwy, serhiy.storchaka, ppperry
2014-10-09 21:28:26Claudiu.Popasetmessageid: <>
2014-10-09 21:28:26Claudiu.Popalinkissue21986 messages
2014-10-09 21:28:25Claudiu.Popacreate