]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #26013: Added compatibility with broken protocol 2 pickles created
authorSerhiy Storchaka <storchaka@gmail.com>
Mon, 18 Jan 2016 19:35:22 +0000 (21:35 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Mon, 18 Jan 2016 19:35:22 +0000 (21:35 +0200)
in old Python 3 versions (3.4.3 and lower).

Lib/_compat_pickle.py
Misc/NEWS

index 6e39d4aee3e8b29fe4acd30c51ac7196d7c0d6da..c0e0443cf2330f9cb0d9ee358f3592eaac3960f3 100644 (file)
@@ -177,6 +177,13 @@ IMPORT_MAPPING.update({
     'DocXMLRPCServer': 'xmlrpc.server',
     'SimpleHTTPServer': 'http.server',
     'CGIHTTPServer': 'http.server',
+    # For compatibility with broken pickles saved in old Python 3 versions
+    'UserDict': 'collections',
+    'UserList': 'collections',
+    'UserString': 'collections',
+    'whichdb': 'dbm',
+    'StringIO':  'io',
+    'cStringIO': 'io',
 })
 
 REVERSE_IMPORT_MAPPING.update({
index 735e420ac28de4f88e675f012e3a15fb7eb7c7a3..69441424f1aaa6b6e0daf56c4fc3adc4f9076f59 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -44,6 +44,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #26013: Added compatibility with broken protocol 2 pickles created
+  in old Python 3 versions (3.4.3 and lower).
+
 - Issue #25850: Use cross-compilation by default for 64-bit Windows.
 
 - Issue #17633: Improve zipimport's support for namespace packages.