You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
vPeriod accepts a period whose start and end are identical. This creates a zero-length period, although the documented requirement is that the start must come before the end.
Parsing and serialization both succeed, preserving the zero-length period.
Expected behavior
A period with identical start and end should be rejected, just as a period whose start is after its end is rejected.
Environment
Operating system: Arch Linux
Python version: Python 3.14.8
icalendar version: 7.3.1.dev775 (tested from repository commit f11437e7)
Additional context
The constructor checks whether start > end, but not whether start == end.
Tested against the latest GitHub main source at commit f11437e. Installed the local checkout in a clean virtual environment with pip install -e . and confirmed the reproduction succeeds.
I included the .ics sample inline above; there is no separate sample file.
I would argue that zero length periods should be accepted because zero length events are accepted.
The purpose of PERIOD in RDATE is to shorten the specification of edited occurrences. Should we want to edit a occurrence now, we would create a special case for 0 length that requires a new VEVENT entry with a recurrence id whereas all others can be done with RDATE.
So, this might strictly adhere to the standard.
If this was found using AI, I would say it is not worth persuing it. @mayankm00007 How did you find the bug?
If this was a genuine request from someone who uses icalendar as a production library, then yes, this has a foundation.
So, I am opening this again with a request to finish the conversation, so I can understand how the use-case came about. I am not debating the fix or the value of the change. That is fine and merged but I would like to know why it is important to restrict the usage for you personally.
... The start
of the period MUST be before the end of the period. Second, a
period of time can also be defined by a start and a positive
duration of time.
The author of this issue referenced "documentation," which is what I assumed they meant. That's why @angatha and I approved and merged #2103.
The purpose of PERIOD in RDATE is to shorten the specification of edited occurrences. Should we want to edit a occurrence now, we would create a special case for 0 length that requires a new VEVENT entry with a recurrence id whereas all others can be done with RDATE.
I agree with the first sentence, but not the second as it wouldn't conform with the above specification or that for RDATE.
Separately, though, this makes it apparent that we have a hole in our issue triage process, which doesn't yet exist. This is not the first time that people have created issues and others jump in to "solve" the issue by creating a PR before it's been confirmed and clarified. Fools rush in.
I'd suggest that any new issue get automatically labeled with Needs peer review, Needs maintainer review, or even Needs discussion, depending on what you think is appropriate.
After confirmation, the person confirming the issue would remove that label and add the label Needs help.
I think, the issue is correct in so far that it is making icalendar more compatible with the standard. Here, however I feel that we are more strict that is required really. I also welcome this change as it allows us to get feedback and give feedback on standard conformance.
I would still like to hear from @mayankm00007 how the issue was found. Could you help me make sense of it?
Activity
github-actions commentedon Nov 10, 2026
Thanks for the issue, @mayankm00007! A maintainer will review it shortly.
github-actions commentedon Nov 10, 2026
Insufficient data
Not enough activity yet to make a reliable assessment.
View full analysis →
This is an automated analysis by AgentScan
fix(period): reject zero-length periods in vPeriod (PyCalendar#2087)
mjonu530 commentedon Nov 15, 2026
Hi! I'm a new contributor to icalendar, and I was able to reproduce this issue on Windows.
My environment:
pip install -e .I followed the reproduction example using
vPeriodwith identical start and end times.My output:
The library accepted the zero-length period without raising an exception. This confirms the reported behavior on my Windows setup.
I also noticed that pull requests are already linked to this issue. Thanks for the work on the fix!
fix(prop): reject a zero-length period (PyCalendar#2103)
niccokunzmann commentedon Nov 23, 2026
I would argue that zero length periods should be accepted because zero length events are accepted.
The purpose of PERIOD in RDATE is to shorten the specification of edited occurrences. Should we want to edit a occurrence now, we would create a special case for 0 length that requires a new VEVENT entry with a recurrence id whereas all others can be done with RDATE.
So, this might strictly adhere to the standard.
If this was found using AI, I would say it is not worth persuing it. @mayankm00007 How did you find the bug?
If this was a genuine request from someone who uses icalendar as a production library, then yes, this has a foundation.
So, I am opening this again with a request to finish the conversation, so I can understand how the use-case came about. I am not debating the fix or the value of the change. That is fine and merged but I would like to know why it is important to restrict the usage for you personally.
stevepiercy commentedon Nov 23, 2026
@niccokunzmann according to the RFC 5545, Section 3.3.9, under its Description:
The author of this issue referenced "documentation," which is what I assumed they meant. That's why @angatha and I approved and merged #2103.
I agree with the first sentence, but not the second as it wouldn't conform with the above specification or that for RDATE.
Separately, though, this makes it apparent that we have a hole in our issue triage process, which doesn't yet exist. This is not the first time that people have created issues and others jump in to "solve" the issue by creating a PR before it's been confirmed and clarified. Fools rush in.
I'd suggest that any new issue get automatically labeled with
Needs peer review,Needs maintainer review, or evenNeeds discussion, depending on what you think is appropriate.After confirmation, the person confirming the issue would remove that label and add the label
Needs help.What do you think?
Finally, I closed the superseded PR #2113.
niccokunzmann commentedon Nov 23, 2026
I think, the issue is correct in so far that it is making icalendar more compatible with the standard. Here, however I feel that we are more strict that is required really. I also welcome this change as it allows us to get feedback and give feedback on standard conformance.
I would still like to hear from @mayankm00007 how the issue was found. Could you help me make sense of it?