Comment 0 for bug 79785

Revision history for this message
Gintautas Miliauskas (gintas) wrote :

I found out that I have KOrganizer installed and it supports iCal (it can
upload calendars too). However, there are two problems concerning
interoperation with SchoolTool.

1) It appears that KOrganizer does not set the Content-Type header.
As a result, getHeader() returns None and SchoolTool spits out a
traceback here:

...
  File ".../schooltool/src/schooltool/rest/cal.py", line 268, in do_PUT
    if ';' in ctype:
exceptions.TypeError: iterable argument required

(rest/cal.py, lines 266-272)
    def do_PUT(self, request):
        ctype = request.getHeader('Content-Type')
>>>> if ';' in ctype:
            ctype = ctype[:ctype.index(';')]
        if ctype != 'text/calendar':
            return textErrorPage(request,
                                 _("Unsupported content type: %s") % ctype)

I don't know if it is a hard requirement for applications to set this
header. If it is, I will report a bug on KOrganizer. Nonetheless, we
might want to relax our iCal processing machinery for compatibility
reasons.

2) iCal files produced by KOrganizer have empty lines between events.
(An example is attached.)

The empty lines between events make SchoolTool choke, however, they
don't produce a traceback; error code 400 is returned with text which
KOrganizer doesn't show. ICalReader raises an unhelpful
ICalParseError during iterEvents: 'Syntax error in line: \n'.
Again, I don't know the specification so I can't say if the empty
lines are valid, however, I think relaxing this restriction is a good
idea for compatibility reasons.

P.S. I want to *KILL* roundup for providing such a measly textarea
for bug descriptions.