[Checkins] SVN: mongopersist/trunk/ Bug: Do not fail if we cannot delete the parent and name attributes.

Stephen Richter cvs-admin at zope.org
Fri Feb 8 14:31:18 UTC 2013


Log message for revision 129231:
  Bug: Do not fail if we cannot delete the parent and name attributes.
  

Changed:
  U   mongopersist/trunk/CHANGES.txt
  U   mongopersist/trunk/src/mongopersist/zope/container.py

-=-
Modified: mongopersist/trunk/CHANGES.txt
===================================================================
--- mongopersist/trunk/CHANGES.txt	2013-02-08 13:51:46 UTC (rev 129230)
+++ mongopersist/trunk/CHANGES.txt	2013-02-08 14:31:18 UTC (rev 129231)
@@ -5,22 +5,22 @@
 0.7.7 (unreleased)
 ------------------
 
-- Nothing changed yet.
+- Bug: Do not fail if we cannot delete the parent and name attributes.
 
 
 0.7.6 (2013-02-08)
 ------------------
 
-- Switch to pymongo.MongoClient, set default write concern values,
-  allow override of write concern values
+- Feature: Switch to ``pymongo.MongoClient``, set default write concern values,
+  allow override of write concern values.
 
 
 0.7.5 (2013-02-06)
 ------------------
 
-- Added, cleaned tests
+- Tests: Added, cleaned tests
 
-- Re-release after missing files in 0.7.4
+- Bug: Re-release after missing files in 0.7.4
 
 0.7.4 (2013-02-05)
 ------------------

Modified: mongopersist/trunk/src/mongopersist/zope/container.py
===================================================================
--- mongopersist/trunk/src/mongopersist/zope/container.py	2013-02-08 13:51:46 UTC (rev 129230)
+++ mongopersist/trunk/src/mongopersist/zope/container.py	2013-02-08 14:31:18 UTC (rev 129231)
@@ -217,9 +217,17 @@
         value = self[key]
         # First remove the parent and name from the object.
         if self._m_mapping_key is not None:
-            delattr(value, self._m_mapping_key)
+            try:
+                delattr(value, self._m_mapping_key)
+            except AttributeError, err:
+                # Sometimes we do not control those attributes.
+                pass
         if self._m_parent_key is not None:
-            delattr(value, self._m_parent_key)
+            try:
+                delattr(value, self._m_parent_key)
+            except AttributeError, err:
+                # Sometimes we do not control those attributes.
+                pass
         # Let's now remove the object from the database.
         if self._m_remove_documents:
             self._m_jar.remove(value)



More information about the checkins mailing list