From 111c7b9011c5838f8276e8729bc8cbeb693d4ac7 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Mon, 18 Jan 2016 21:35:22 +0200 Subject: [PATCH] Issue #26013: Added compatibility with broken protocol 2 pickles created in old Python 3 versions (3.4.3 and lower). --- Lib/_compat_pickle.py | 7 +++++++ Misc/NEWS | 3 +++ 2 files changed, 10 insertions(+) diff --git a/Lib/_compat_pickle.py b/Lib/_compat_pickle.py index 6e39d4aee3e..c0e0443cf23 100644 --- a/Lib/_compat_pickle.py +++ b/Lib/_compat_pickle.py @@ -177,6 +177,13 @@ '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({ diff --git a/Misc/NEWS b/Misc/NEWS index 735e420ac28..69441424f1a 100644 --- 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.