[issue6137] Pickle migration: Should pickle map copy_reg to copyreg?

2009-06-03 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Unpickling e.g. StringIO objects doesn't seem to work: s = pickle.load(open(stringio.pickle, rb)) Traceback (most recent call last): File stdin, line 1, in module File /home/antoine/py3k/picklecompat-6137/Lib/pickle.py, line 1351, in load

[issue6137] Pickle migration: Should pickle map copy_reg to copyreg?

2009-06-03 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: An improved patch with tests. It has no tests for fix_imports=False, though. -- Added file: http://bugs.python.org/file14175/compat_pickle2.diff ___ Python tracker rep...@bugs.python.org

[issue6137] Pickle migration: Should pickle map copy_reg to copyreg?

2009-06-03 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: A new patch which also includes reverse mappings, so that protocol = 2 pickles created with 3.x can also work under 2.x. (that is, it also solves #3675) -- dependencies: +Python 2.6 can't read sets pickled with Python 3.0 Added file:

[issue6137] Pickle migration: Should pickle map copy_reg to copyreg?

2009-06-03 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Updated patch with a couple of documentation and function prototype fixes. -- dependencies: -Python 2.6 can't read sets pickled with Python 3.0 Added file: http://bugs.python.org/file14178/compat_pickle4.diff

[issue6137] Pickle migration: Should pickle map copy_reg to copyreg?

2009-06-03 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Sorry, last patch had a couple of minor issues -- Added file: http://bugs.python.org/file14179/compat_pickle5.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6137

[issue6137] Pickle migration: Should pickle map copy_reg to copyreg?

2009-06-03 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file14177/compat_pickle3.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6137 ___

[issue6137] Pickle migration: Should pickle map copy_reg to copyreg?

2009-06-03 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file14178/compat_pickle4.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6137 ___

[issue6137] Pickle migration: Should pickle map copy_reg to copyreg?

2009-06-01 Thread Matthias Kievernagel
Matthias Kievernagel mkie...@web.de added the comment: Applied the patch http://bugs.python.org/file14124/compat_pickle.diff to rev. 73106. Patch applies fine, 'make test' passes and it solves my problem. (which is far from a complete test case though - only 5 small pickles) Thanks, Matthias

[issue6137] Pickle migration: Should pickle map copy_reg to copyreg?

2009-06-01 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Some comments on the patch: - I don't understand why you create a static twotuple object rather than simply using Py_BuildValue((OO), ...). Mutating tuples is bad. - I don't think you need to call PyDict_Contains() before PyDict_GetItem(). The

[issue6137] Pickle migration: Should pickle map copy_reg to copyreg?

2009-06-01 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- components: +Library (Lib) -None priority: - critical type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6137 ___

[issue6137] Pickle migration: Should pickle map copy_reg to copyreg?

2009-05-31 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: If I understood correctly, #3675 is about making pickle data generated by Python 3 readable by Python 2. Only if a protocol = 2 is specified. Therefore it seems it's only a matter of translating module names. --

[issue6137] Pickle migration: Should pickle map copy_reg to copyreg?

2009-05-30 Thread Alexandre Vassalotti
Alexandre Vassalotti alexan...@peadrop.com added the comment: If I understood correctly, #3675 is about making pickle data generated by Python 3 readable by Python 2. However, this issue is about compatibility in the other direction—i.e., making Python 2 pickles readable by Python 3, which is

[issue6137] Pickle migration: Should pickle map copy_reg to copyreg?

2009-05-28 Thread Matthias Kievernagel
New submission from Matthias Kievernagel mkie...@web.de: Hello, while porting something to Python 3.1a1 I found out that Python 3 cannot load most Python 2 pickles of any protocol because copy_reg has been renamed to copyreg. Found this comment by Skip Montanaro in related issue:

[issue6137] Pickle migration: Should pickle map copy_reg to copyreg?

2009-05-28 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: #3675 is a similar issue, too bad nothing could be done to solve it... -- nosy: +alexandre.vassalotti, pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6137