Importing .ics into Calendar on Mac (El Capitan) b

2019-09-13 01:30发布

问题:

I have created an .ics file using Python and the calendar library. An example file is given below. This example contains three events which, in real life, would be timetable events for a class.

b'BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//Python iCalendar timetable//\r\nBEGIN:VEVENT\r\nSUMMARY:COURSE NAME 2016-17 LECTURE - abc (A.N.Other)\r\nDTSTART;TZID=Europe/London;VALUE=DATE-TIME:20161011T160000\r\nDTEND;TZID=Europe/London;VALUE=DATE-TIME:20161011T170000\r\nDTSTAMP;VALUE=DATE-TIME:20160923T015643Z\r\nUID:20161011160000/abc/course2016-17\r\nLOCATION:Room1232\r\nORGANIZER;CN=A.N.Other;ROLE=Boss:MAILTO:A.N.Other@somewhere.com\r\nEND:VEVENT\r\nBEGIN:VEVENT\r\nSUMMARY:COURSE NAME 2016-17 LECTURE - def (John Smith)\r\nDTSTART;TZID=Europe/London;VALUE=DATE-TIME:20161012T110000\r\nDTEND;TZID=Europe/London;VALUE=DATE-TIME:20161012T120000\r\nDTSTAMP;VALUE=DATE-TIME:20160923T015643Z\r\nUID:20161012110000/def/course2016-17\r\nLOCATION:Room334\r\nORGANIZER;CN=A.N.Other;ROLE=Boss:MAILTO:A.N.Other@somewhere.com\r\nEND:VEVENT\r\nBEGIN:VEVENT\r\nSUMMARY:COURSE NAME 2016-17 LECTURE - ghi (Jane Doe)\r\nDTSTART;TZID=Europe/London;VALUE=DATE-TIME:20161014T100000\r\nDTEND;TZID=Europe/London;VALUE=DATE-TIME:20161014T110000\r\nDTSTAMP;VALUE=DATE-TIME:20160923T015643Z\r\nUID:20161014100000/ghi/course2016-17\r\nLOCATION:Room442\r\nORGANIZER;CN=A.N.Other;ROLE=Boss:MAILTO:A.N.Other@somewhere.com\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n'

The .ics file produced validates using http://severinghaus.org/projects/icv/

When the ics file is opened using Calendar on a Mac running El Capitan the events are imported into the selected Exchange calendar. However, having done that, Calendar then refuses to connect to the Exchange Server to sync the calendars. If I try to add an invitee, for example, an error message is displayed:

Calendar can’t save the event “COURSE NAME 2016-17 LECTURE - abc (A.N.Other)” to the Exchange server.
There was an error attempting to send your changes to the exchange server.

If I delete the calendar, I can then add events manually which will be uploaded to the exchange server with no problems.

So it seems that uploaded the events from the ics file causes a problem that prevents Calendar connecting to the Exchange Server.

Is there any reason why the events coded in the .ics file shown should cause a problem that prevents Calendar connecting to the Exchange Server?

回答1:

I've no idea why but it seems that including a LOCATION field in the .ics file may have been causing some problems. I've started a new question at Including a LOCATION field in an .ics calendar file stops Calendar on MacOS El Capitan communicating with Exchange Server to see if anyone has an answer.