[issue6137] Make pickle generated by Python 3.x compatible with 2.x and vice-versa.
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6137 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6137] Make pickle generated by Python 3.x compatible with 2.x and vice-versa.
Antoine Pitrou pit...@free.fr added the comment: Guido, Raymond suggested we ask your input on this one, although it's obviously a bit late (the patch has been committed). -- nosy: +gvanrossum ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6137 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6137] Make pickle generated by Python 3.x compatible with 2.x and vice-versa.
Guido van Rossum gu...@python.org added the comment: I'm not on IRC. What exactly is your question for me? What is Raymond's view? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6137 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6137] Make pickle generated by Python 3.x compatible with 2.x and vice-versa.
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: I vaguely remember you rejecting a proposal along these lines when Brett was doing the library renaming. The patch (as applied) turns on the renaming automatically when used with protocol 2 (i.e. all object names are stored with their 2.x names, not their new names). Hagen points out that 3.1 proto 2 pickles can't be read by 3.0. I would think that the back-translation should be disabled by default or else we're going to live with the 2.x names for a very long time. I don't care much one way or the other. Just thought you should see it before it got released and set in stone. It's not too late for a one line change, setting the fix_imports default from True to False. FWIW, the argument for leaving the default as True is the theory that anyone using protocol 2 is likely doing so to exchange data with 2.x. -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6137 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6137] Make pickle generated by Python 3.x compatible with 2.x and vice-versa.
Guido van Rossum gu...@python.org added the comment: Ah. How about only doing back-translation when protocol=2 (or lower) is explicitly selected? I don't much like that 3.0 will be to read pickles written by 3.1 with the default protocol (i.e. 3), but I don't mind breaking protocol 2, since that's most likely (as you say) intended for Python 2. So the default for fix_imports would be None, and the __init__ would check if it's None, and then set it to (protocol = 2). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6137 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6137] Make pickle generated by Python 3.x compatible with 2.x and vice-versa.
Antoine Pitrou pit...@free.fr added the comment: Ah. How about only doing back-translation when protocol=2 (or lower) is explicitly selected? Well, this is exactly what is implemented! I don't much like that 3.0 will be to read pickles written by 3.1 with the default protocol (i.e. 3), I suppose you meant to say will be unable, but it isn't, since protocol 3 pickles are not affected at all by this patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6137 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6137] Make pickle generated by Python 3.x compatible with 2.x and vice-versa.
Guido van Rossum gu...@python.org added the comment: On Tue, Jun 9, 2009 at 12:16 PM, Antoine Pitrourep...@bugs.python.org wrote: Antoine Pitrou pit...@free.fr added the comment: Ah. How about only doing back-translation when protocol=2 (or lower) is explicitly selected? Well, this is exactly what is implemented! Ah, I missed that. Fine then! I don't much like that 3.0 will be to read pickles written by 3.1 with the default protocol (i.e. 3), I suppose you meant to say will be unable, Indeed. but it isn't, since protocol 3 pickles are not affected at all by this patch. Good. So I'm okay with the status quo -- too bad 3.0 can't read those pickles, but that's the deal with abandoning 3.0... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6137 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6137] Make pickle generated by Python 3.x compatible with 2.x and vice-versa.
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Thanks for taking a look and opining. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6137 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6137] Make pickle generated by Python 3.x compatible with 2.x and vice-versa.
Antoine Pitrou pit...@free.fr added the comment: I've added an entry in the what's new file in r73254. -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6137 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6137] Make pickle generated by Python 3.x compatible with 2.x and vice-versa.
Hagen Fürstenau hfuerste...@gmx.net added the comment: The latest patch is missing the file Lib/_compat.pickle.py. (Seems as if you forgot to svn add it after patching.) -- nosy: +hagen ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6137 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6137] Make pickle generated by Python 3.x compatible with 2.x and vice-versa.
Alexandre Vassalotti alexan...@peadrop.com added the comment: Oops. Here is a new patch with _compat_pickle.py. -- Added file: http://bugs.python.org/file14186/compat_pickle7.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6137 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6137] Make pickle generated by Python 3.x compatible with 2.x and vice-versa.
Antoine Pitrou pit...@free.fr added the comment: Committed in r73236 in the hope that it gets a bit more testing before rc2/final. -- assignee: alexandre.vassalotti - resolution: - fixed stage: patch review - committed/rejected status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6137 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6137] Make pickle generated by Python 3.x compatible with 2.x and vice-versa.
Hagen Fürstenau hfuerste...@gmx.net added the comment: I think it is worth noting that now some Python 3.1 protocol 2 pickles can't be read by Python 3.0. We probably don't have to do anything about that, but perhaps it should be mentioned somewhere? Docs, release notes? -- status: pending - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6137 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6137] Make pickle generated by Python 3.x compatible with 2.x and vice-versa.
Alexandre Vassalotti alexan...@peadrop.com added the comment: Here is an updated patch based on Antoine's latest patch. Summary of changes: * Updated docstrings of Pickler and Unpickler in the pickle module. * Fixed pickle._Pickler to consider fix_imports only for protocol 3 * Made module name remapping in _pickle more robust: - added PyUnicode_Check on global_name and module_name; - used PyDict_GetItemWithError instead of PyDict_GetItem * Changed Py_BuildValue((OO), ...) to its faster equivalent PyTuple_Pack(2, ...). I don't really the idea of remapping names generated by Pickler, since it breaks the identity guarantee in save_global(). However, I agree this is an example where practicality beats purity. So, I do not oppose to the change. -- assignee: - alexandre.vassalotti title: Pickle migration: Should pickle map copy_reg to copyreg? - Make pickle generated by Python 3.x compatible with 2.x and vice-versa. Added file: http://bugs.python.org/file14184/compat_pickle6.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6137 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com