Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15.0-beta.2"]
tox-test: ["default"]

steps:
Expand Down
20 changes: 20 additions & 0 deletions khal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,23 @@
__description__ = "A standards based terminal calendar"
__license__ = "Expat/MIT, see COPYING"
__homepage__ = "https://lostpackets.de/khal/"


# Monkeypatch _strptime to support Python 3.15+ where parsing day of month (%d or %e)
# without a year directive raises a ValueError.
try:
import _strptime
except ImportError:
pass
else:
_orig_strptime = _strptime._strptime

def _custom_strptime(data_string, format_string):
has_year = "%y" in format_string or "%Y" in format_string
has_day = "%d" in format_string or "%e" in format_string
if has_day and not has_year:
data_string = f"{data_string} 2024"
format_string = f"{format_string} %Y"
return _orig_strptime(data_string, format_string)

_strptime._strptime = _custom_strptime
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ classifiers = [
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3.15",
"Topic :: Communications",
"Topic :: Utilities",
]
requires-python = ">=3.10,<3.15"
requires-python = ">=3.10,<3.16"
dependencies = [
"click>=3.2",
"click_log>=0.2.0",
Expand Down
Loading