skarim / vobject

A full-featured Python package for parsing and creating iCalendar and vCard files
https://vobject.sameenkarim.com
258 stars 93 forks source link

Zero Duration Exception #162

Open tfinke opened 3 years ago

tfinke commented 3 years ago

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:

Thanks again for your great software and best regards

Finke