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

useless error message if timezone is unknown #174

Open
htgoebel opened this issue Nov 29, 2021 · 0 comments · May be fixed by #182
Open

useless error message if timezone is unknown #174

htgoebel opened this issue Nov 29, 2021 · 0 comments · May be fixed by #182

Comments

@htgoebel
Copy link
Contributor

When parsing a vevent using a custom time zone (see #173), error messages like this, which - sorry to say - are no use:

ERROR:root:'(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna'

Expected result

In the error message I'd like to learn

  • what is the error - what is wrong
  • in which file
  • if the file contains several item: which entry is the bogus one

I tracked this message down to https://github.com/eventable/vobject/blob/0.9.6.1/vobject/icalendar.py#L83. At this point there is no chance to know the file or the item, not even the item-element. Anyhow, the message should at least read

ERROR:root:Unknown Timezone: '(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna'

How to reproduce

import vobject

# for reproducing of thus bug, this stipped down vevent is enough
VEVENT = """
BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
UID:1-2-3-4
DTSTART;TZID="(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna"
 :20200504T110000
DTEND;TZID="(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna":2
 0200504T113000
DTSTAMP:20200303T123456Z
SUMMARY:Some Appointment
END:VEVENT
END:VCALENDAR
"""

obj = tuple(vobject.readComponents(VEVENT))[0]
obj.prettyPrint()
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

Successfully merging a pull request may close this issue.

1 participant