[Vobject] Patch to allow created of UTCDateTime fields

Phil Mayers p.mayers at imperial.ac.uk
Mon May 8 19:40:08 CDT 2006


Without the attached patch, I am unable to create any fields with 
behavior of "DateTimeBehavior" (and thus UTCDateTimeBehavior which is a 
sub-class) - I get:

 >>> ne.add('CREATED')
*** ParseError: "'' is not a valid DATE-TIME"

"DateOrDateTimeBehavior" which (obviously, since it's e.g. DTSTART) 
works has similar code in its transformToNative method.


--- vobject/icalendar.py~       2006-05-09 01:34:31.000000000 +0100
+++ vobject/icalendar.py        2006-05-09 01:34:57.000000000 +0100
@@ -550,6 +550,7 @@
          """
          if obj.isNative: return obj
          obj.isNative = True
+        if obj.value == '': return obj
          obj.value=str(obj.value)
          #we're cheating a little here, parseDtstart allows DATE
          obj.value=parseDtstart(obj)


More information about the VObject mailing list