[CalendarServer-changes] [2261] CalendarServer/trunk/twistedcaldav/ical.py

source_changes at macosforge.org source_changes at macosforge.org
Fri Mar 28 09:30:27 PDT 2008


Revision: 2261
          http://trac.macosforge.org/projects/calendarserver/changeset/2261
Author:   cdaboo at apple.com
Date:     2008-03-28 09:30:27 -0700 (Fri, 28 Mar 2008)

Log Message:
-----------
Bypass vobject's charset auto-detection mode and instead require all calendar data to be utf-8.

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/ical.py

Modified: CalendarServer/trunk/twistedcaldav/ical.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/ical.py	2008-03-26 23:53:57 UTC (rev 2260)
+++ CalendarServer/trunk/twistedcaldav/ical.py	2008-03-28 16:30:27 UTC (rev 2261)
@@ -206,7 +206,10 @@
             C{stream}.
         """
         try:
-            return clazz(None, vobject=readComponents(stream).next())
+            return clazz(None, vobject=readComponents(stream, findBegin=False).next())
+        except UnicodeDecodeError, e:
+            stream.seek(0)
+            raise ValueError("%s: %s" % (e, stream.read()))
         except vParseError, e:
             raise ValueError(e)
         except StopIteration, e:

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20080328/bcc96aa5/attachment.html


More information about the calendarserver-changes mailing list