Commit fe6775d6 authored by Guido van Rossum's avatar Guido van Rossum

Merge changes from ZODB3 3.1 final release. Bump version to 3.1+.

parent 1678cc25
...@@ -116,6 +116,15 @@ def tryToResolveConflict(self, oid, committedSerial, oldSerial, newpickle, ...@@ -116,6 +116,15 @@ def tryToResolveConflict(self, oid, committedSerial, oldSerial, newpickle,
return file.getvalue(1) return file.getvalue(1)
except ConflictError: except ConflictError:
return 0 return 0
except:
# If anything else went wrong, catch it here and avoid passing an
# arbitrary exception back to the client. The error here will mask
# the original ConflictError. A client can recover from a
# ConflictError, but not necessarily from other errors. But log
# the error so that any problems can be fixed.
zLOG.LOG("Conflict Resolution", zLOG.ERROR,
"Unexpected error", error=sys.exc_info())
return 0
class ConflictResolvingStorage: class ConflictResolvingStorage:
"Mix-in class that provides conflict resolution handling for storages" "Mix-in class that provides conflict resolution handling for storages"
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# #
############################################################################## ##############################################################################
__version__ = '3.1b2' __version__ = '3.1+'
import sys import sys
import cPersistence, Persistence import cPersistence, Persistence
......
...@@ -104,7 +104,7 @@ class ConflictResolvingStorage: ...@@ -104,7 +104,7 @@ class ConflictResolvingStorage:
# pickle is to commit two different transactions relative to # pickle is to commit two different transactions relative to
# revid1 that add two to _value. # revid1 that add two to _value.
revid2 = self._dostoreNP(oid, revid=revid1, data=zodb_pickle(obj)) revid2 = self._dostoreNP(oid, revid=revid1, data=zodb_pickle(obj))
self.assertRaises(AttributeError, self.assertRaises(ConflictError,
self._dostoreNP, self._dostoreNP,
oid, revid=revid1, data=zodb_pickle(obj)) oid, revid=revid1, data=zodb_pickle(obj))
...@@ -122,7 +122,7 @@ class ConflictResolvingStorage: ...@@ -122,7 +122,7 @@ class ConflictResolvingStorage:
# pickle is to commit two different transactions relative to # pickle is to commit two different transactions relative to
# revid1 that add two to _value. # revid1 that add two to _value.
revid2 = self._dostoreNP(oid, revid=revid1, data=zodb_pickle(obj)) revid2 = self._dostoreNP(oid, revid=revid1, data=zodb_pickle(obj))
self.assertRaises(TypeError, self.assertRaises(ConflictError,
self._dostoreNP, self._dostoreNP,
oid, revid=revid1, data=zodb_pickle(obj)) oid, revid=revid1, data=zodb_pickle(obj))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment