[CalendarServer-changes] [4322] CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.xattrprops .patch

source_changes at macosforge.org source_changes at macosforge.org
Wed Jun 3 17:43:40 PDT 2009


Revision: 4322
          http://trac.macosforge.org/projects/calendarserver/changeset/4322
Author:   wsanchez at apple.com
Date:     2009-06-03 17:43:39 -0700 (Wed, 03 Jun 2009)
Log Message:
-----------
Handle KeyError for missing xattr names.

Added Paths:
-----------
    CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.xattrprops.patch

Added: CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.xattrprops.patch
===================================================================
--- CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.xattrprops.patch	                        (rev 0)
+++ CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.xattrprops.patch	2009-06-04 00:43:39 UTC (rev 4322)
@@ -0,0 +1,33 @@
+Index: twisted/web2/dav/xattrprops.py
+===================================================================
+--- twisted/web2/dav/xattrprops.py	(revision 26899)
++++ twisted/web2/dav/xattrprops.py	(working copy)
+@@ -123,6 +123,10 @@
+         """
+         try:
+             data = self.attrs.get(self._encode(qname))
++        except KeyError:
++            raise HTTPError(StatusResponse(
++                    responsecode.NOT_FOUND,
++                    "No such property: {%s}%s" % qname))
+         except IOError, e:
+             if e.errno in _ATTR_MISSING:
+                 raise HTTPError(StatusResponse(
+@@ -198,6 +202,8 @@
+         try:
+             try:
+                 self.attrs.remove(key)
++            except KeyError:
++                pass
+             except IOError, e:
+                 if e.errno not in _ATTR_MISSING:
+                     raise
+@@ -221,6 +227,8 @@
+         key = self._encode(qname)
+         try:
+             self.attrs.get(key)
++        except KeyError:
++            return False
+         except IOError, e:
+             if e.errno in _ATTR_MISSING or e.errno == errno.ENOENT:
+                 return False
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20090603/8d9c5253/attachment.html>


More information about the calendarserver-changes mailing list