[Zodb-checkins] SVN: ZODB/trunk/src/ Bugs Fixed

Jim Fulton jim at zope.com
Tue Sep 1 17:35:09 EDT 2009


Log message for revision 103473:
  Bugs Fixed
  ----------
  
  - The helper function ZODB.blob.is_blob_record didn't handle having
    None passed to it, but database "delete" records have None for their
    data.
  

Changed:
  U   ZODB/trunk/src/CHANGES.txt
  U   ZODB/trunk/src/ZODB/blob.py
  U   ZODB/trunk/src/ZODB/tests/testblob.py

-=-
Modified: ZODB/trunk/src/CHANGES.txt
===================================================================
--- ZODB/trunk/src/CHANGES.txt	2009-09-01 20:15:01 UTC (rev 103472)
+++ ZODB/trunk/src/CHANGES.txt	2009-09-01 21:35:08 UTC (rev 103473)
@@ -2,6 +2,17 @@
  Change History
 ================
 
+3.9.0c3 (2009-09-01)
+====================
+
+Bugs Fixed
+----------
+
+- The helper function ZODB.blob.is_blob_record didn't handle having
+  None passed to it, but database "delete" records have None for their
+  data.
+
+
 3.9.0c2 (2009-09-01)
 ====================
 

Modified: ZODB/trunk/src/ZODB/blob.py
===================================================================
--- ZODB/trunk/src/ZODB/blob.py	2009-09-01 20:15:01 UTC (rev 103472)
+++ ZODB/trunk/src/ZODB/blob.py	2009-09-01 21:35:08 UTC (rev 103473)
@@ -946,7 +946,7 @@
     storage to another.
 
     """
-    if 'ZODB.blob' in record:
+    if record and ('ZODB.blob' in record):
         unpickler = cPickle.Unpickler(cStringIO.StringIO(record))
         unpickler.find_global = find_global_Blob
 

Modified: ZODB/trunk/src/ZODB/tests/testblob.py
===================================================================
--- ZODB/trunk/src/ZODB/tests/testblob.py	2009-09-01 20:15:01 UTC (rev 103472)
+++ ZODB/trunk/src/ZODB/tests/testblob.py	2009-09-01 21:35:08 UTC (rev 103473)
@@ -511,6 +511,11 @@
     >>> ZODB.blob.is_blob_record('cWaaaa\nC\nq\x01.')
     False
 
+    As does None, which may occur in delete records:
+
+    >>> ZODB.blob.is_blob_record(None)
+    False
+
     >>> db.close()
     """
 



More information about the Zodb-checkins mailing list