Skip to content

Commit

Permalink
Force usage of pytz
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
iamleot committed Oct 31, 2024
1 parent 106e4d0 commit b8f068e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
======
Expand Down
4 changes: 4 additions & 0 deletions khal/icalendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit b8f068e

Please sign in to comment.