🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.dist
Article #1114

Bug#1149368: khal: FTBFS against python 3.15rc2 (several date parsing errors)

#1114
From: Arto Jantunen
Date: Sat, 17 Oct 2026 10:40
91 lines
4755 bytes
--=-=-=
Content-Type: text/plain

Control: tags -1 +patch

Attached is a patch originating from the Fedora project fixing the
reported test failures with Python 3.15. This has been submitted
upstream as a Github PR, but has not been merged at least so far.

-- 
Arto Jantunen


--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline;
 filename=0001-Apply-Fedora-patch-for-Python-3.15-support.patch
Content-Description: patch

From 83aa4a44b062fdb4760e0d4fcd7edd9e3df65ce4 Mon Sep 17 00:00:00 2001
From: Arto Jantunen <viiru@debian.org>
Date: Sat, 17 Oct 2026 13:25:44 +0300
Subject: [PATCH] Apply Fedora patch for Python 3.15 support

---
 debian/patches/1002_support_python_315.patch | 40 ++++++++++++++++++++
 debian/patches/series                        |  1 +
 2 files changed, 41 insertions(+)
 create mode 100644 debian/patches/1002_support_python_315.patch

diff --git a/debian/patches/1002_support_python_315.patch b/debian/patches/1002_support_python_315.patch
new file mode 100644
index 000000000000..ae6386329a05
--- /dev/null
+++ b/debian/patches/1002_support_python_315.patch
@@ -0,0 +1,40 @@
+From bc181c736c191883dae8646f10bb176e2820bb5f Mon Sep 17 00:00:00 2001
+From: Filipe Rosset <rosset.filipe%40gmail.com>
+Date: Tue, 9 Jun 2026 07:53:49 -0400
+Subject: strptime: monkey patch for day-without-year behavior
+
+Origin: https://github.com/pimutils/khal/pull/1470
+Bug-Debian: https://bugs.debian.org/1149368
+
+---
+ khal/__init__.py | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+diff --git a/khal/__init__.py b/khal/__init__.py
+index 36b60842b..e02c37c48 100644
+--- a/khal/__init__.py
++++ b/khal/__init__.py
+@@ -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
diff --git a/debian/patches/series b/debian/patches/series
index 662468c6fa70..3b90320ee69c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,4 +1,5 @@
 1001_shebang.patch
+1002_support_python_315.patch
 2001_No_RSS_news_in_docs.patch
 2002_Fix_intersphinx_mapping.patch
 2003_Avoid_privacy_breach_in_sphinx_doc.patch
-- 
2.53.0


--=-=-=--
Technical Details
Message-ID: <NP9Zw-67lT-45@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.eu.feeder.erje.net!feeder.erje.net!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
References: <NIJY5-2yUu-3@gated-at.bofh.it> <NIJY5-2yUu-3@gated-at.bofh.it>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.eu.feeder.erje.net!feeder.erje.net!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
From: Arto Jantunen <viiru@debian.org>
Newsgroups: linux.debian.bugs.dist
Subject: Bug#1149368: khal: FTBFS against python 3.15rc2 (several date parsing errors)
Date: Sat, 17 Oct 2026 12:40:02 +0200
Message-ID: <NP9Zw-67lT-45@gated-at.bofh.it>
References: <NIJY5-2yUu-3@gated-at.bofh.it> <NIJY5-2yUu-3@gated-at.bofh.it>
X-Original-To: 1149368@bugs.debian.org
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Sat Oct 17 10:33:08 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -1.7
Reply-To: Arto Jantunen <viiru@debian.org>, 1149368@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: team+python@tracker.debian.org
X-Debian-Pr-Message: followup 1149368
X-Debian-Pr-Package: src:khal
X-Debian-Pr-Keywords: forky ftbfs sid
X-Debian-Pr-Source: khal
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Debian-User: viiru
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/1997187
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 91
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Sat, 17 Oct 2026 13:31:38 +0300
X-Original-Message-ID: <87bj8shb3p.fsf@farfetchd>
X-Original-References: <02707552c5c44e388e8a7a5795347021@debian.org> <02707552c5c44e388e8a7a5795347021@debian.org>