jspricke / python-remind

Python library to convert between Remind and iCalendar
GNU General Public License v3.0
13 stars 6 forks source link

ERROR:root:'Romance Standard Time' #19

Open TigerP opened 1 year ago

TigerP commented 1 year ago

Since 30 June I get ERROR:root:'Romance Standard Time' when parsing an ics file from microsoft office365. romance.ics.txt

shell$ cat romance.ics | ~/venv39/bin/ics2rem
ERROR:root:'Romance Standard Time'
ERROR:root:'Romance Standard Time'
REM Apr 18 2023 AT 14:00 DURATION 1:00 TAG PUBLIC MSG CVC Meeting
shell$

I can replace 'Romance Standard Time' with 'W. Europe Standard Time' and then there are no errors. It seems to me that this 'Romance Standard Time' is only present in events created by zoom. I would like to see ics2rem to handle the file without generating an error.

jspricke commented 1 year ago

Interesting, thanks for opening the issue. Some background: "Romance Standard Time" is a Windows time zone ID. Everyone else uses IANA time zone IDs. https://stackoverflow.com/questions/70608037/how-can-use-romance-standard-time-to-set-the-time-zone https://www.quora.com/Where-did-Romance-Standard-Time-come-from-and-why-Romance?share=1 The icalendar specification does not define which names to use: https://datatracker.ietf.org/doc/html/rfc5545#section-3.2.19. This is actually not a bug in python-remind but in the python-vobject library used by python-remind:

from vobject.base import readOne
readOne(open("romance.ics.txt").read())

Produces the same error. We could open a bug with python-vobject but the project did not see any activity since 2018: https://github.com/eventable/vobject A simple workaround for you would be to add the timezone as an alias. This works for me on Debian (as root):

# cd /usr/share/zoneinfo/
# ln -s CET "Romance Standard Time"

Alternatively python-icalendar seems to support the Windows names: https://github.com/collective/icalendar/blob/master/src/icalendar/windows_to_olson.py#L85 but not sure if porting is worthwhile.

TigerP commented 1 year ago

Thank you for the explanation and the link to the RFC and it seems to me that exchange is forgetting to add a VTIMEZONE for 'Romance Standard Time' to the ics file.

The workaround you mention, does not seem to work on CentOS 8 Stream.

I did create a workaround for myself by replacing 'Romance Standard Time' with 'W. Europe Standard Time' before calling ics2rem.

Based on issue 185 of vobject I find it very unlikely that anything will be done with any issue that is created.