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

Mandatory properties are neither enforced nor set to a default #596

Open
danielschenk opened this issue Mar 7, 2024 · 2 comments
Open

Comments

@danielschenk
Copy link

According to RFC 5545, every VCAL needs a PRODID and VERSION. If those are not explicitly added, Calendar.to_ical() produces non-conforming output because they are missing.

It could be a deliberate design choice to leave this open. But I wonder, how often do people want to generate invalid output, and shouldn't the library enforce a valid calendar object somehow?

Just some suggestions here.

VERSION

As this library claims to be implementing RFC 5545, I think this should just be 2.0 by default. If you add it again with a different value, that's fine, it will be replaced.

PRODID

What about setting this to something like -//python.collective.icalendar//NONSGML python.collective.icalendar.app.event//EN? (I'm not sure how exactly these strings should be constructed, I just wrote something based on a test case I saw in this repo). Same here, if you add it again with a different value, it will be replaced.

Both of above improvements are fully backwards-compatible, AFAIK. Please let me know your thoughts.

@danielschenk danielschenk changed the title Mandatory properties are not enforced Mandatory properties are not enforced or set to a default Mar 7, 2024
@danielschenk danielschenk changed the title Mandatory properties are not enforced or set to a default Mandatory properties are neither enforced nor set to a default Mar 7, 2024
@niccokunzmann
Copy link
Member

I would think that is is nice to add a few default properties that make the calendar valid. If you like to create a Pull Request, that would be welcome!

@danielschenk
Copy link
Author

I'll gladly do! I will dive into the code as soon as I have time for it.

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

2 participants