Alexandre Vassalotti <[email protected]> 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 <[email protected]>
<http://bugs.python.org/issue6137>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com