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

khal import fails with "icalendar has no attribute windows_to_olson" #1366

Open
craftyguy opened this issue Nov 4, 2024 · 1 comment
Open

Comments

@craftyguy
Copy link

Describe the bug
khal import path/to/ics fails with: module 'icalendar' has no attribute 'windows_to_olson'

If applicable: Stack Trace

module 'icalendar' has no attribute 'windows_to_olson'
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/khal/controllers.py", line 613, in import_ics
    vevents = split_ics(ics, random_uid, conf['locale']['default_timezone'])
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/khal/icalendar.py", line 59, in split_ics
    if item['TZID'] in icalendar.windows_to_olson.WINDOWS_TO_OLSON:
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'icalendar' has no attribute 'windows_to_olson'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/khal/cli.py", line 464, in import_ics
    controllers.import_ics(
  File "/usr/lib/python3.12/site-packages/khal/controllers.py", line 615, in import_ics
    raise FatalError(error)
khal.exceptions.FatalError: module 'icalendar' has no attribute 'windows_to_olson'

To Reproduce
Steps to reproduce the behavior:

`khal import

Expected behavior

khal should import the ics without failing

OS, version, khal version and how you installed it:

  • The output of khal --version: khal, version 0.11.3
  • Installation method [e.g. PyPI, git, OS repo]: distro repo
  • python version [e.g. python 3.9]: 3.12
  • OS [e.g. arch]: Alpine Linux (edge)
  • Your khal config file
my redacted config file
[view]
frame = color
dynamic_days = false
event_view_always_visible = true

[calendars]

<redacted>

[default]
highlight_event_days = true
default_calendar = personal_calendar
timedelta = 7d

[locale]
timeformat = %H:%M
dateformat = %d/%m/%Y
longdateformat = %d/%m/%Y
datetimeformat = %d/%m/%Y %H:%M
longdatetimeformat = %d/%m/%Y %H:%M
local_timezone =  America/Los_Angeles
default_timezone = America/Los_Angeles
weeknumbers = left
# sunday
firstweekday = 6

[keybindings]
export = E

  • The versions of your other python packages [e.g. the output of pip freeze]

Additional context
Here's an ics that fails, I've validated it with https://icalendar.org/validator.html :

BEGIN:VCALENDAR
VERSION:2.0
PRODID:icalendar-ruby
CALSCALE:GREGORIAN
METHOD:PUBLISH
BEGIN:VTIMEZONE
TZID:America/Los_Angeles
BEGIN:DAYLIGHT
DTSTART:20250309T030000
TZOFFSETFROM:-0800
TZOFFSETTO:-0700
RRULE:FREQ=YEARLY;BYDAY=2SU;BYMONTH=3
TZNAME:PDT
END:DAYLIGHT
BEGIN:STANDARD
DTSTART:20241103T010000
TZOFFSETFROM:-0700
TZOFFSETTO:-0800
RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=11
TZNAME:PST
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTAMP:20241104T173109Z
UID:7b522402-7939-4648-bbbb-bbbbbbbbbbbb
DTSTART;TZID=America/Los_Angeles:20241113T110000
DTEND;TZID=America/Los_Angeles:20241113T120000
LOCATION:https://example.com/appt-aab
 bd4d868c4?origin=client
ORGANIZER;CN=Important Meeting People:mailto:[email protected]
 om
SUMMARY:Important meeting
URL;VALUE=URI:https://example.com/appt-aab
 bd4d868c4?origin=client
END:VEVENT
END:VCALENDAR
@d7415
Copy link
Collaborator

d7415 commented Nov 4, 2024

This is due to a breaking change in icalendar and should be fixed by #1364.

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

2 participants