[Zodb-checkins] SVN: ZODB/branches/3.8/ Added missing data attribute for conflict errors.

Jim Fulton jim at zope.com
Sat Jul 21 10:03:32 EDT 2007


Log message for revision 78264:
  Added missing data attribute for conflict errors.
  

Changed:
  U   ZODB/branches/3.8/NEWS.txt
  U   ZODB/branches/3.8/src/ZODB/POSException.py
  A   ZODB/branches/3.8/src/ZODB/tests/test_misc.py

-=-
Modified: ZODB/branches/3.8/NEWS.txt
===================================================================
--- ZODB/branches/3.8/NEWS.txt	2007-07-21 13:10:57 UTC (rev 78263)
+++ ZODB/branches/3.8/NEWS.txt	2007-07-21 14:03:32 UTC (rev 78264)
@@ -25,6 +25,8 @@
 - (3.8.0b3) Make it possible to examine oid and (in some situations) database
   name of persistent object references during conflict resolution.
 
+- (3.8.0b3) Added missing data attribute for conflict errors.
+
 ZEO
 ---
 

Modified: ZODB/branches/3.8/src/ZODB/POSException.py
===================================================================
--- ZODB/branches/3.8/src/ZODB/POSException.py	2007-07-21 13:10:57 UTC (rev 78263)
+++ ZODB/branches/3.8/src/ZODB/POSException.py	2007-07-21 14:03:32 UTC (rev 78264)
@@ -106,12 +106,11 @@
             # avoid circular import chain
             from ZODB.utils import get_pickle_metadata
             self.class_name = "%s.%s" % get_pickle_metadata(data)
-##        else:
-##            if message != "data read conflict error":
-##                raise RuntimeError
 
         self.serials = serials
 
+        self.data = data
+
     def __str__(self):
         extras = []
         if self.oid:

Added: ZODB/branches/3.8/src/ZODB/tests/test_misc.py
===================================================================
--- ZODB/branches/3.8/src/ZODB/tests/test_misc.py	                        (rev 0)
+++ ZODB/branches/3.8/src/ZODB/tests/test_misc.py	2007-07-21 14:03:32 UTC (rev 78264)
@@ -0,0 +1,37 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Misc tests :)
+"""
+
+import unittest
+from zope.testing import doctest
+
+def conflict_error_retains_data_passed():
+    r"""
+    
+ConflictError can be passed a data record which it claims to retain as
+an attribute.
+
+    >>> import ZODB.POSException
+    >>> 
+    >>> ZODB.POSException.ConflictError(data='cM\nC\n').data
+    'cM\nC\n'
+
+    """
+
+def test_suite():
+    return unittest.TestSuite((
+        doctest.DocTestSuite(),
+        ))
+


Property changes on: ZODB/branches/3.8/src/ZODB/tests/test_misc.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native



More information about the Zodb-checkins mailing list