[CalendarServer-changes] [1537] CalendarServer/trunk
source_changes at macosforge.org
source_changes at macosforge.org
Thu May 17 13:39:00 PDT 2007
Revision: 1537
http://trac.macosforge.org/projects/calendarserver/changeset/1537
Author: cdaboo at apple.com
Date: 2007-05-17 13:39:00 -0700 (Thu, 17 May 2007)
Log Message:
-----------
Fix problem with invalid RRULE syntax causing a 500 error and also not causing file write rollback.
Modified Paths:
--------------
CalendarServer/trunk/twistedcaldav/method/put_common.py
Added Paths:
-----------
CalendarServer/trunk/lib-patches/dateutil/dateutil.rrule.patch
CalendarServer/trunk/lib-patches/dateutil/dateutil.tz.patch
Added: CalendarServer/trunk/lib-patches/dateutil/dateutil.rrule.patch
===================================================================
--- CalendarServer/trunk/lib-patches/dateutil/dateutil.rrule.patch (rev 0)
+++ CalendarServer/trunk/lib-patches/dateutil/dateutil.rrule.patch 2007-05-17 20:39:00 UTC (rev 1537)
@@ -0,0 +1,14 @@
+--- dateutil/rrule.py.orig 2007-05-17 15:43:39.000000000 -0400
++++ dateutil/rrule.py 2007-05-17 15:44:44.000000000 -0400
+@@ -965,9 +965,9 @@
+ ignoretz=ignoretz,
+ tzinfos=tzinfos)
+ except AttributeError:
+- raise "unknown parameter '%s'" % name
++ raise ValueError, "unknown parameter '%s'" % name
+ except (KeyError, ValueError):
+- raise "invalid '%s': %s" % (name, value)
++ raise ValueError, "invalid '%s': %s" % (name, value)
+ return rrule(dtstart=dtstart, cache=cache, **rrkwargs)
+
+ def _parse_rfc(self, s,
Added: CalendarServer/trunk/lib-patches/dateutil/dateutil.tz.patch
===================================================================
--- CalendarServer/trunk/lib-patches/dateutil/dateutil.tz.patch (rev 0)
+++ CalendarServer/trunk/lib-patches/dateutil/dateutil.tz.patch 2007-05-17 20:39:00 UTC (rev 1537)
@@ -0,0 +1,13 @@
+--- dateutil/tz.py.orig 2007-05-17 15:43:48.000000000 -0400
++++ dateutil/tz.py 2007-05-17 15:45:03.000000000 -0400
+@@ -709,9 +709,9 @@
+ if tzid is None:
+ keys = self._vtz.keys()
+ if len(keys) == 0:
+- raise "no timezones defined"
++ raise ValueError, "no timezones defined"
+ elif len(keys) > 1:
+- raise "more than one timezone available"
++ raise ValueError, "more than one timezone available"
+ tzid = keys[0]
+ return self._vtz.get(tzid)
Modified: CalendarServer/trunk/twistedcaldav/method/put_common.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/method/put_common.py 2007-05-17 20:37:09 UTC (rev 1536)
+++ CalendarServer/trunk/twistedcaldav/method/put_common.py 2007-05-17 20:39:00 UTC (rev 1537)
@@ -472,6 +472,9 @@
responsecode.FORBIDDEN,
NumberOfRecurrencesWithinLimits(PCDATAElement(str(ex.max_allowed)))
))
+ except ValueError, e:
+ log.err(str(e))
+ raise HTTPError(ErrorResponse(responsecode.FORBIDDEN, (caldav_namespace, "valid-calendar-data")))
destination.writeDeadProperty(davxml.GETContentType.fromString("text/calendar"))
return None
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20070517/dc737523/attachment.html
More information about the calendarserver-changes
mailing list