[Python-checkins] r78413 - in python/branches/release26-maint: Lib/bsddb/dbshelve.py Misc/NEWS

r.david.murray python-checkins at python.org
Wed Feb 24 03:35:33 CET 2010


Author: r.david.murray
Date: Wed Feb 24 03:35:33 2010
New Revision: 78413
Log:
Merged revisions 78412 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/trunk
........
 r78412 | r.david.murray | 2010年02月23日 21:31:27 -0500 (2010年2月23日) | 6 lines
 
 Issue 7975: in python 2.6 bsddb.dbshelve switched from DictMixin to
 MutableMapping, and thereby lost functionality because the replacement
 functionality was implemented incorrectly or incompletely). Since bsddb
 isn't in py3k, this patch just goes back to using DictMixin in order to
 correct the regression. 
........
Modified:
 python/branches/release26-maint/ (props changed)
 python/branches/release26-maint/Lib/bsddb/dbshelve.py
 python/branches/release26-maint/Misc/NEWS
Modified: python/branches/release26-maint/Lib/bsddb/dbshelve.py
==============================================================================
--- python/branches/release26-maint/Lib/bsddb/dbshelve.py	(original)
+++ python/branches/release26-maint/Lib/bsddb/dbshelve.py	Wed Feb 24 03:35:33 2010
@@ -59,16 +59,11 @@
 return cPickle.dumps(object, bin=protocol)
 
 
-if sys.version_info[0:2] <= (2, 5) :
- try:
- from UserDict import DictMixin
- except ImportError:
- # DictMixin is new in Python 2.3
- class DictMixin: pass
- MutableMapping = DictMixin
-else :
- import collections
- MutableMapping = collections.MutableMapping
+try:
+ from UserDict import DictMixin
+except ImportError:
+ # DictMixin is new in Python 2.3
+ class DictMixin: pass
 
 #------------------------------------------------------------------------
 
@@ -111,7 +106,7 @@
 class DBShelveError(db.DBError): pass
 
 
-class DBShelf(MutableMapping):
+class DBShelf(DictMixin):
 """A shelf to hold pickled objects, built upon a bsddb DB object. It
 automatically pickles/unpickles data objects going to/from the DB.
 """
@@ -162,10 +157,6 @@
 else:
 return self.db.keys()
 
- if sys.version_info[0:2] >= (2, 6) :
- def __iter__(self) :
- return self.db.__iter__()
-
 
 def open(self, *args, **kwargs):
 self.db.open(*args, **kwargs)
Modified: python/branches/release26-maint/Misc/NEWS
==============================================================================
--- python/branches/release26-maint/Misc/NEWS	(original)
+++ python/branches/release26-maint/Misc/NEWS	Wed Feb 24 03:35:33 2010
@@ -69,6 +69,8 @@
 Library
 -------
 
+- Issue #7975: correct regression in dict methods supported by bsddb.dbshelve.
+
 - Issue #7959: ctypes callback functions are now registered correctly
 with the cylce garbage collector.
 


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /