[CalendarServer-changes] [5788] CalendarServer/branches/new-store/txdav/propertystore/xattr.py

source_changes at macosforge.org source_changes at macosforge.org
Sat Jun 19 17:52:14 PDT 2010


Revision: 5788
          http://trac.macosforge.org/projects/calendarserver/changeset/5788
Author:   cdaboo at apple.com
Date:     2010-06-19 17:52:13 -0700 (Sat, 19 Jun 2010)
Log Message:
-----------
Don't fail when removing a missing property.

Modified Paths:
--------------
    CalendarServer/branches/new-store/txdav/propertystore/xattr.py

Modified: CalendarServer/branches/new-store/txdav/propertystore/xattr.py
===================================================================
--- CalendarServer/branches/new-store/txdav/propertystore/xattr.py	2010-06-20 00:50:39 UTC (rev 5787)
+++ CalendarServer/branches/new-store/txdav/propertystore/xattr.py	2010-06-20 00:52:13 UTC (rev 5788)
@@ -107,12 +107,13 @@
     #
 
     def __delitem__(self, key):
+        """
+        We do not fail if the key does not current exist as per WebDAV PROPPATCH note above.
+        """
         validKey(key)
 
         if key in self.modified:
             del self.modified[key]
-        elif self._encodeKey(key) not in self.attrs:
-            raise KeyError(key)
 
         self.removed.add(key)
 
@@ -232,7 +233,13 @@
 
         for key in removed:
             assert key not in modified
-            del attrs[self._encodeKey(key)]
+            try:
+                del attrs[self._encodeKey(key)]
+            except KeyError:
+                pass
+            except IOError, e:
+                if e.errno != _ERRNO_NO_ATTR:
+                    raise
 
         for key in modified:
             assert key not in removed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100619/95de2e3b/attachment-0001.html>


More information about the calendarserver-changes mailing list