[issue21986] Pickleability of code objects is inconsistent

2014-10-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: 2. It is normal. The third argument of copyreg.pickle() is not used now. The patch LGTM. -- title: Idle: disable pickleability of user code objects -> Pickleability of code objects is inconsistent ___ Python track

[issue21986] Pickleability of code objects is inconsistent

2014-10-09 Thread Terry J. Reedy
Terry J. Reedy added the comment: Here are the issues for me. 1. Except for your interest, this is a lower priority for me that most all of the other 125 Idle issues. 2. I am not familiar with pickling and wonder about the following in the patch. It deletes a statememt copyreg.pickle(type

[issue21986] Pickleability of code objects is inconsistent

2014-10-09 Thread Claudiu Popa
Claudiu Popa added the comment: Terry, can I do something to move this issue forward? -- ___ Python tracker ___ ___ Python-bugs-list m

[issue21986] Pickleability of code objects is inconsistent

2014-08-25 Thread Claudiu Popa
Changes by Claudiu Popa : -- stage: needs patch -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue21986] Pickleability of code objects is inconsistent

2014-07-16 Thread Claudiu Popa
Claudiu Popa added the comment: TypeError is raised only in Python 2, in Python 3 it's PicklingError. -- ___ Python tracker ___ ___ Py

[issue21986] Pickleability of code objects is inconsistent

2014-07-16 Thread Terry J. Reedy
Terry J. Reedy added the comment: ppperry: Component Windows (or Macintosh) means Windows (or Mac) specific. The rpc code is general to all systems. -- ___ Python tracker ___ _

[issue21986] Pickleability of code objects is inconsistent

2014-07-16 Thread Terry J. Reedy
Terry J. Reedy added the comment: There is no unittest module for rpc yet. Should the pickle test include a test that pickling a code object fails, and with the proper exception? Is ppperry correct about PicklingError? Chainmap is new in 3.3 so 2.7 would need the copy version of the patch. -

[issue21986] Pickleability of code objects is inconsistent

2014-07-16 Thread Claudiu Popa
Claudiu Popa added the comment: Thanks, Serhiy. -- Added file: http://bugs.python.org/file35969/issue21986.patch ___ Python tracker ___ __

[issue21986] Pickleability of code objects is inconsistent

2014-07-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Instead of copying dispatch_table, use ChainMap. -- nosy: +serhiy.storchaka ___ Python tracker ___ ___

[issue21986] Pickleability of code objects is inconsistent

2014-07-16 Thread Claudiu Popa
Claudiu Popa added the comment: Maybe something like the attached patch. It doesn't have tests, though, I didn't find any tests for the idlelib.rpc anyway. -- keywords: +patch Added file: http://bugs.python.org/file35968/idlelib.patch ___ Python trac

[issue21986] Pickleability of code objects is inconsistent

2014-07-16 Thread ppperry
Changes by ppperry : -- components: +Windows ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue21986] Pickleability of code objects is inconsistent

2014-07-16 Thread Martin v . Löwis
Martin v. Löwis added the comment: I agree with Claudiu. IDLE should pickle with a private dispatch_table. -- nosy: +loewis ___ Python tracker ___ ___

[issue21986] Pickleability of code objects is inconsistent

2014-07-15 Thread Claudiu Popa
Claudiu Popa added the comment: It works in IDLE because it registers a custom pickling for code objects, in idlelib.rpc: copyreg.pickle(types.CodeType, pickle_code, unpickle_code) where pickle_code / unpickle_code calls marshal.dumps/loads. Although, I admit that this is weird. If idlelib

[issue21986] Pickleability of code objects is inconsistent

2014-07-15 Thread Terry J. Reedy
Terry J. Reedy added the comment: Code is really a code object, so the compile does not seem to be the problem. In 2.7, on Win7, I get exactly the same output after removing the possibly spurious space in the string posted. (ppperry), what system (OS) are you using. (In the future, please rep

[issue21986] Pickleability of code objects is inconsistent

2014-07-15 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +kbk, roger.serwy, terry.reedy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue21986] Pickleability of code objects is inconsistent

2014-07-15 Thread ppperry
Changes by ppperry : -- type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.

[issue21986] Pickleability of code objects is inconsistent

2014-07-15 Thread ppperry
New submission from ppperry: In IDLE: >>> code = compile("dummy_code", "", "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(\\