Claudiu Popa added the comment:
Terry, can I do something to move this issue forward?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21986
___
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
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
Changes by Claudiu Popa pcmantic...@gmail.com:
--
stage: needs patch - patch review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21986
___
___
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
Martin v. Löwis added the comment:
I agree with Claudiu. IDLE should pickle with a private dispatch_table.
--
nosy: +loewis
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21986
___
Changes by ppperry maprea...@olum.org:
--
components: +Windows
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21986
___
___
Python-bugs-list
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
Serhiy Storchaka added the comment:
Instead of copying dispatch_table, use ChainMap.
--
nosy: +serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21986
___
Claudiu Popa added the comment:
Thanks, Serhiy.
--
Added file: http://bugs.python.org/file35969/issue21986.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21986
___
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.
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 rep...@bugs.python.org
http://bugs.python.org/issue21986
Claudiu Popa added the comment:
TypeError is raised only in Python 2, in Python 3 it's PicklingError.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21986
___
New submission from ppperry:
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
Changes by ppperry maprea...@olum.org:
--
type: - behavior
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21986
___
___
Python-bugs-list mailing
Changes by Antoine Pitrou pit...@free.fr:
--
nosy: +kbk, roger.serwy, terry.reedy
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21986
___
___
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
17 matches
Mail list logo