Search code examples
pythonparsingicalendar

Python icalendar not recognising key



Hi There,

I'm new to parsing iCal and was wondering why I am getting the following error.

I have the following iCal format and I'm using the icalendar library for python to parse it. Unfortunately the ATTENDEE key is not being recognised and will only be recognised when placing a tab beside the new line. How come this is the case? The iCal validator claims this is valid iCal

 BEGIN:VCALENDAR
 PRODID:-// Example classroom timetable
 VERSION:2.0
 BEGIN:VEVENT
 ATTENDEE;CN=91827364;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;DELEGATED-FROM
 ="mailto:[email protected]":mailto:[email protected]
 ATTENDEE;CN=81726354;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;DELEGATED-FROM 
 ="mailto:[email protected]":mailto:[email protected]
 ATTENDEE;CN=31602424;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;DELEGATED-FROM
 ="mailto:[email protected]":mailto:[email protected]
 ATTENDEE;CN=40049549;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;DELEGATED-FROM
 ="mailto:[email protected]":mailto:[email protected]
 CREATED:20180730T220042Z
 DESCRIPTION:MA1234 - MATHEMATIC\n\n Event Type:LECTURE\n\n 
   Lecturer(s):DR.1\n\n Location(s):CLASSROOM 3
 DTEND:20170926T170000Z
 DTSTAMP:20180730T220042Z
 DTSTART:20170926T160000Z
 LAST-MODIFIED:20170601T105200Z
 LOCATION:CLASSROOM3
 SEQUENCE:0
 SUMMARY:MA1234 - MATHEMATICS
 UID:[email protected]
 END:VEVENT
 END:VCALENDAR

Thanks for your help!


Solution

  • Lines longer than 75 characters must be folded in a specific way.. CRLF immediately followed by a single linear white-space character (i.e., SPACE or HTAB)

    https://www.rfc-editor.org/rfc/rfc5545#section-3.1