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

'zoneinfo.ZoneInfo' object has no attribute 'localize' #1399

Open
garyemiller opened this issue Mar 17, 2025 · 1 comment
Open

'zoneinfo.ZoneInfo' object has no attribute 'localize' #1399

garyemiller opened this issue Mar 17, 2025 · 1 comment

Comments

@garyemiller
Copy link

Describe the bug
I have 0.11.2 from the gentoo package. When I open my calendar I get stack traces.

If applicable: Stack Trace

kong ~ $ khal calendar
Unknown exception happened.
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/khal/khalendar/khalendar.py", line 398, in _update_vevent
    update(event.raw, href=href, etag=etag, calendar=calendar)
  File "/usr/lib/python3.12/site-packages/khal/khalendar/backend.py", line 246, in update
    self._update_impl(vevent, href, calendar)
  File "/usr/lib/python3.12/site-packages/khal/khalendar/backend.py", line 367, in _update_impl
    dtstartend = expand_vevent(vevent, href)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/khal/icalendar.py", line 315, in expand
    dtstartl = set(rrule)
               ^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/khal/icalendar.py", line 256, in sanitize_datetime
    date = events_tz.localize(date)
           ^^^^^^^^^^^^^^^^^^
AttributeError: 'zoneinfo.ZoneInfo' object has no attribute 'localize'
warning: Skipping 4b7d37c7-ef1b-8e37-d66d-a588e4617fc8/09f5f6f1-0815-4f1d-b206-0e30ac8d3be2.ics: 'zoneinfo.ZoneInfo' object has no attribute 'localize'
warning: This event will not be available in khal.
Unknown exception happened.
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/khal/khalendar/khalendar.py", line 398, in _update_vevent
    update(event.raw, href=href, etag=etag, calendar=calendar)
  File "/usr/lib/python3.12/site-packages/khal/khalendar/backend.py", line 246, in update
    self._update_impl(vevent, href, calendar)
  File "/usr/lib/python3.12/site-packages/khal/khalendar/backend.py", line 367, in _update_impl
    dtstartend = expand_vevent(vevent, href)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/khal/icalendar.py", line 315, in expand
    dtstartl = set(rrule)
               ^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/khal/icalendar.py", line 256, in sanitize_datetime
    date = events_tz.localize(date)
           ^^^^^^^^^^^^^^^^^^
AttributeError: 'zoneinfo.ZoneInfo' object has no attribute 'localize'
warning: Skipping 4b7d37c7-ef1b-8e37-d66d-a588e4617fc8/ae20ceba-02b4-4d39-a09a-d9b7cb8f9155.ics: 'zoneinfo.ZoneInfo' object has no attribute 'localize'
warning: This event will not be available in khal.

To Reproduce
Unsure.

Expected behavior
No stack trace

Screenshots
See stack trace.

OS, version, khal version and how you installed it:
Gentoo unstable, khal 0.11.2 instelled by emerge.
icalendar 5.1.1 insatalled

Additional context

@WhyNotHugo
Copy link
Member

See: #1361

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