SVN: ZODB/trunk/src/ Bugs Fixed

Jim Fulton <[email protected]>
Newsgroups gmane.comp.python.zope.zodb.cvs
Message-ID <[email protected]>
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()
     """
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.