Package: khal
Version: 1:0.11.3-2
Severity: normal
Tags: upstream patch

Dear Maintainer,

I see the following traceback when trying to do 'khal -v DEBUG import 
<ical-file>':

-------------------------------------------------------------------------------
module 'icalendar' has no attribute 'windows_to_olson'
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/khal/controllers.py", line 613, in 
import_ics
    vevents = split_ics(ics, random_uid, conf['locale']['default_timezone'])
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-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'
-------------------------------------------------------------------------------

Apparently python3-icalendar recently moved windows_to_olson from
icalendar.windows_to_olson to icalendar.timezone.windows_to_olson.
In Debian python3-icalendar migrated from 5.x to 6.x some days ago
bring in this change.

The following local modification fixed the issue for me:

-------------------------------------------------------------------------------
--- a/usr/lib/python3/dist-packages/khal/icalendar.py   2024-11-21 
17:42:30.603815639 +0100
+++ b/usr/lib/python3/dist-packages/khal/icalendar.py   2024-11-21 
17:29:42.814434966 +0100
@@ -56,8 +56,8 @@
         # Standard Time' for 'Pacific/Auckland' in Olson format), we convert 
any
         # Windows format timezones to Olson.
         if item.name == 'VTIMEZONE':
-            if item['TZID'] in icalendar.windows_to_olson.WINDOWS_TO_OLSON:
-                key = icalendar.windows_to_olson.WINDOWS_TO_OLSON[item['TZID']]
+            if item['TZID'] in 
icalendar.timezone.windows_to_olson.WINDOWS_TO_OLSON:
+                key = 
icalendar.timezone.windows_to_olson.WINDOWS_TO_OLSON[item['TZID']]
             else:
                 key = item['TZID']
             tzs[key] = item
-------------------------------------------------------------------------------

Greetings,

-- Sebastian

-- System Information:
Debian Release: trixie/sid
  APT prefers testing
  APT policy: (500, 'testing'), (250, 'unstable'), (100, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, armhf, arm64

Kernel: Linux 6.11.7-amd64 (SMP w/32 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages khal depends on:
ii  python3                3.12.6-1
ii  python3-atomicwrites   1.4.1-1
ii  python3-click          8.1.7-2
ii  python3-click-log      0.3.2-1
ii  python3-configobj      5.0.9-1
ii  python3-dateutil       2.9.0-3
ii  python3-icalendar      6.0.1-1
ii  python3-pkg-resources  74.1.2-2
ii  python3-tz             2024.1-2
ii  python3-tzlocal        5.2-1.1
ii  python3-urwid          2.6.15-1
ii  python3-xdg            0.28-2

Versions of packages khal recommends:
ii  python3-setproctitle  1.3.3-1+b5

Versions of packages khal suggests:
ii  bash-completion  1:2.14.0-2
pn  khal-doc         <none>

-- no debconf information

Reply via email to