[chandler-users] [possible bug] Problem with ICS file import

Jeffrey Harris jeffrey at osafoundation.org
Thu May 29 16:57:54 PDT 2008


Hi Peter,

> My problem is, that Chandler refuses to import an ICS file I exported
>  from Palm Desktop using Linkesoft DIMEX tool 
> (http://linkesoft.com/dimex/).

As it turns out, this is not valid iCalendar.

Historically, Palm used VCALENDAR 1.0 (iCalendar is VCALENDAR 2.0).
This looks like a VCALENDAR 1.0 file that just had its version tweaked.

Specifically, in iCalendar, a UID is required for every VEVENT, and
there aren't any in this file.  Seems like a bug in DIMEX's conversion 
routine.

Probably Chandler's iCalendar import code ought to be tweaked to handle
old vCalendar data.

In the mean time, you probably want to just add random (but different)
UIDs to your VEVENTs.  vobject does this automatically when serializing
iCalendar; so with a Python that has vobject installed (Chandler's
version of Python does) you could do:

>>> import vobject old = file('filename.ics')
 >>> new = file('new.ics', 'wb')
 >>> calendar = vobject.readOne(old)
 >>> calendar.serialize(new)
>>> new.close()

> According to iCalendar validator
> (http://severinghaus.org/projects/icv/) the file is a valid ICS.

Yeah, "validator" is a misnomer there.  It tests whether ical4j parses a
file, which is helpful but not really validation.

> Finally recoding the file to UNIX EOL from Windows CRLF format did
> not help either :-(.

As it happens, iCalendar theoretically requires Windows style 
line-endings, happily no parsers actually care what line endings you use.

Sincerely,
Jeffrey


More information about the chandler-users mailing list