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

Zero Duration Exception #162

Open
tfinke opened this issue Jan 19, 2021 · 0 comments
Open

Zero Duration Exception #162

tfinke opened this issue Jan 19, 2021 · 0 comments

Comments

@tfinke
Copy link

tfinke commented Jan 19, 2021

Dear Maintainers,

first of all: thank you very much for your great class package.

I have an ICS entry which contains the following time data:

DTSTART:20170922T120000
DTEND;TZID=/freeassociation.sourceforge.net/Europe/Berlin: 20170922T140000

If the DTSTART time zone is considered UTC this entry has a zero duration.

In vobject/icalendar.py the class Duration provides a method transformToNative. In case of zero duration it seems to raise an exception ParseError("DURATION must have a single duration string") because it finds less than one durations. The exceptions seems to be provided for cases of more than on (inconsistent) durations.

May I suggest:

  • improving the error message (e.g. displaying the entry UID and the number of durations actually found)
  • avoiding the exception in case of zero duration (when len(deltalist) == 0); in this case a duration of 0:00 should be returned.

Thanks again for your great software and best regards

Finke

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