Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8560226

Browse files
committed
The default shelve pickle protocol should have been 3.
1 parent f6e1806 commit 8560226

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

Doc/library/shelve.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ lots of shared sub-objects. The keys are ordinary strings.
2323
database file is opened for reading and writing. The optional *flag* parameter
2424
has the same interpretation as the *flag* parameter of :func:`dbm.open`.
2525

26-
By default, version 2 pickles are used to serialize values. The version of the
26+
By default, version 3 pickles are used to serialize values. The version of the
2727
pickle protocol can be specified with the *protocol* parameter.
2828

2929
By default, mutations to persistent-dictionary mutable entries are not

Lib/shelve.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def __init__(self, dict, protocol=None, writeback=False,
8484
keyencoding="utf-8"):
8585
self.dict = dict
8686
if protocol is None:
87-
protocol = 2
87+
protocol = 3
8888
self._protocol = protocol
8989
self.writeback = writeback
9090
self.cache = {}

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ Library
157157

158158
- Issue #1581476: Always use the Tcl global namespace when calling into Tcl.
159159

160+
- The shelve module now defaults to pickle protocol 3.
161+
160162
- Fix a bug in the trace module where a bytes object from co_lnotab had its
161163
items being passed through ord().
162164

0 commit comments

Comments
 (0)