summaryrefslogtreecommitdiffstats
path: root/Lib/_compat_pickle.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-01-18 19:35:22 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-01-18 19:35:22 (GMT)
commit111c7b9011c5838f8276e8729bc8cbeb693d4ac7 (patch)
treeeec5c3fee71a7c2f78dfb50507bd7a5f19d0d0dc /Lib/_compat_pickle.py
parent084f7e4012f5d9e16f82ab5527bb592fdf1badef (diff)
downloadcpython-111c7b9011c5838f8276e8729bc8cbeb693d4ac7.zip
cpython-111c7b9011c5838f8276e8729bc8cbeb693d4ac7.tar.gz
cpython-111c7b9011c5838f8276e8729bc8cbeb693d4ac7.tar.bz2
Issue #26013: Added compatibility with broken protocol 2 pickles created
in old Python 3 versions (3.4.3 and lower).
Diffstat (limited to 'Lib/_compat_pickle.py')
-rw-r--r--Lib/_compat_pickle.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/_compat_pickle.py b/Lib/_compat_pickle.py
index 6e39d4a..c0e0443 100644
--- a/Lib/_compat_pickle.py
+++ b/Lib/_compat_pickle.py
@@ -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({