Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mutliple BEGIN:VCALENDAR in ical output #97

Open
tobixen opened this issue Jan 2, 2023 · 0 comments
Open

Mutliple BEGIN:VCALENDAR in ical output #97

tobixen opened this issue Jan 2, 2023 · 0 comments

Comments

@tobixen
Copy link
Owner

tobixen commented Jan 2, 2023

Filing this on behalf of @Maltimore ... I hope you will find this "message" ... and sorry for not paying much attention to my IRC session nowadays. I found this in my log:

2023-01-01 09:44 < maltimore> Hi! This is my first time using IRC. Can you confirm that you see this message?
2023-01-01 09:58 < maltimore> I'm going to post my question anyways, and might copy it to github later if this doesn't work ;)
2023-01-01 10:01 < maltimore> So I'm using calendar-cli to download my calendar from a vcal server. This file should then be read with the python icalendar package, namely with Calendar.from_ical method. But when I do that I get an error  message essentially complaining that there are multiple BEGIN:VCALENDAR components in the ical file I get from calendar-cli. So my question is, is it icalendar-compliant to have multiple BEGIN:VCALENAR blocks in an ical file?
2023-01-01 10:02 < maltimore> if I manually delete BEGIN:VCALENDAR and END:VCALENDAR lines such that there is only one begin and one end, then it works fine

First of all, if you want to pull something out from the calendar and then load it into the python icalendar package, then you should not be using calendar-cli, then you should be using the caldav library directly. After fetching an object using the caldav library, you can use the properties obj.icalendar_object or obj.icalendar_component to get the icalendar object out.

When fetching multiple objects from a caldav server, it will always encapsulate each object with BEGIN:VCALENDAR and END:VCALENDAR, and the full data file cannot be loaded into the icalendar library without either splitting it up or removing the excess begin/end markers first. I'm too lazy to check the RFCs now, but I'm pretty confident that this is in accordance with the caldav RFC (RFC 4791). I have no idea if the icalendar RFC (RFC 5545) allows or disallows several VCALENDAR objects in the same file, but I would be surprised RFC 5545 disallows the behaviour that is mandated in RFC 4791 :-)

@tobixen tobixen changed the title Mutliple BEGIN:VCALENDAR Mutliple BEGIN:VCALENDAR in ical output Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant