#1149376 cloud-init: FTBFS against python 3.15rc2 (Day of month directive '%d' may not be used without a year directive)

Package:
src:cloud-init
Source:
src:cloud-init
Submitter:
Margarita Manterola
Date:
2026-09-29 18:03:03 UTC
Severity:
normal
Tags:
#1149376#5
Date:
2026-09-29 18:01:10 UTC
From:
To:
Hi!

While rebuilding the python related packages against the Python 3.15rc2
version we found that cloud-init fails to build from source:
https://debusine.debian.net/debian/r-python-python3.15/artifact/4856104/

 From the log, the error seems to happen here:
=================================== FAILURES
===================================
_
TestParseCILogLine.test_parse_logline_returns_event_for_amazon_linux_2_line
__

self = <tests.unittests.analyze.test_dump.TestParseCILogLine object at
0x7fa4a4504710>

     def test_parse_logline_returns_event_for_amazon_linux_2_line(self):
         line = (
             "Apr 30 19:39:11 cloud-init[2673]: handlers.py[DEBUG]:
start:"
             " init-local/check-cache: attempting to read from cache
[check]"
         )

         # Python deprecated parsing dates without a year due to
ambiguous
         # leap year behavior. Parsing dates without leap years is
something
         # that cloud-init analyze attempts to support.
         #
         # This test will start to fail in a future version of Python if
         # the deprecated behavior changes in a breaking way.
         with warnings.catch_warnings():
             warnings.simplefilter("ignore", category=DeprecationWarning)
             # Generate the expected value using `datetime`, so that TZ
             # determination is consistent with the code under test.

It seems that we are now at the Python version that causes this to fail,
as this is the error that is eventually raised:

E               ValueError: Day of month directive '%d' may not be used
without a year directive. Parsing dates involving a day of month without
a year is ambiguous and fails to parse leap day. Add a year to the input
and format. See https://github.com/python/cpython/issues/70647.

Setting the severity to important for now. Once Python 3.15 is released
and later added to python3-defaults, this bug will become release
critical.