From b8f068e7b9a6f1e8c0cb59dac47cc0f6f54c97f0 Mon Sep 17 00:00:00 2001 From: Leonardo Taccari Date: Thu, 31 Oct 2024 13:14:08 +0100 Subject: [PATCH 1/3] Force usage of pytz For timezone functionalities icalendar can use both pytz and zoneinfo, preferring zoneinfo. We rely on pytz for several attributes, stick to it. Fixes #1361. Should obsolete #1363. --- CHANGELOG.rst | 1 + khal/icalendar.py | 4 ++++ pyproject.toml | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 47cb66302..ca48b4d55 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -33,6 +33,7 @@ not released yet * NEW support for color theme, command, and formatter plugins * FIX an issue where ikhal would forget changes to time or date fields if you left the field with page up/down or meta+enter +* UPDATED REQUIREMENT icalendar is now required >= 6.0.0 0.11.3 ====== diff --git a/khal/icalendar.py b/khal/icalendar.py index 39e6eda8f..3d1fcd71f 100644 --- a/khal/icalendar.py +++ b/khal/icalendar.py @@ -37,6 +37,10 @@ logger = logging.getLogger('khal') +# Force use of pytz because we rely on functionalities not available in +# zoneinfo. +icalendar.use_pytz() + def split_ics(ics: str, random_uid: bool=False, default_timezone=None) -> List: """split an ics string into several according to VEVENT's UIDs diff --git a/pyproject.toml b/pyproject.toml index 597a6046a..7dc930926 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,7 @@ requires-python = ">=3.8,<3.13" dependencies = [ "click>=3.2", "click_log>=0.2.0", - "icalendar>=4.0.3", + "icalendar>=6.0.0", "urwid>=2.6.15", "pyxdg", "pytz", From 31884beeb2f92a98b8a57f2896fcc10849ec7f49 Mon Sep 17 00:00:00 2001 From: Leonardo Taccari Date: Thu, 31 Oct 2024 13:21:27 +0100 Subject: [PATCH 2/3] Add myself to AUTHORS.txt Per "Hacking" document. --- AUTHORS.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.txt b/AUTHORS.txt index 891fe947f..664c249da 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -57,3 +57,4 @@ Julian Wollrath Mattori Birnbaum - me [at] mattori [dot] com - https://mattori.com Pi R Alnoman Kamil - noman [at] kamil [dot] gr - https://kamil.gr +Leonardo Taccari - iamleot [at] gmail [dot] com From ce339cd23ec9ebf24482e68bd784dc443217385e Mon Sep 17 00:00:00 2001 From: Leonardo Taccari Date: Thu, 31 Oct 2024 14:13:45 +0100 Subject: [PATCH 3/3] Fix windows_to_olson inclusion In icalendar-6.0.0 windows_to_olson is part of icalendar.timezone. --- khal/icalendar.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/khal/icalendar.py b/khal/icalendar.py index 3d1fcd71f..a50e5f691 100644 --- a/khal/icalendar.py +++ b/khal/icalendar.py @@ -59,8 +59,8 @@ def split_ics(ics: str, random_uid: bool=False, default_timezone=None) -> List: # 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