From 438d272e338024c5aa1c0a6ddd1ff1dcb20e403e Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Tue, 3 Feb 2009 04:16:34 +0000 Subject: [PATCH] The default shelve pickle protocol should have been 3. --- Doc/library/shelve.rst | 2 +- Lib/shelve.py | 2 +- Misc/NEWS | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Doc/library/shelve.rst b/Doc/library/shelve.rst index 1c35f4781cda..44eff59d67da 100644 --- a/Doc/library/shelve.rst +++ b/Doc/library/shelve.rst @@ -23,7 +23,7 @@ lots of shared sub-objects. The keys are ordinary strings. database file is opened for reading and writing. The optional *flag* parameter has the same interpretation as the *flag* parameter of :func:`dbm.open`. - By default, version 0 pickles are used to serialize values. The version of the + By default, version 3 pickles are used to serialize values. The version of the pickle protocol can be specified with the *protocol* parameter. By default, mutations to persistent-dictionary mutable entries are not diff --git a/Lib/shelve.py b/Lib/shelve.py index cf6dac65f47e..fb2fa93b0100 100644 --- a/Lib/shelve.py +++ b/Lib/shelve.py @@ -84,7 +84,7 @@ class Shelf(collections.MutableMapping): keyencoding="utf-8"): self.dict = dict if protocol is None: - protocol = 2 + protocol = 3 self._protocol = protocol self.writeback = writeback self.cache = {} diff --git a/Misc/NEWS b/Misc/NEWS index ae32ca16636f..204c0177bb70 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -113,6 +113,8 @@ Library - Issue #1581476: Always use the Tcl global namespace when calling into Tcl. +- The shelve module now defaults to pickle protocol 3. + - Issue #2047: shutil.move() could believe that its destination path was inside its source path if it began with the same letters (e.g. "src" vs. "src.new"). -- 2.47.3