[mythtv-commits] [MythTV/mythtv] fcb36c: Fix datetime.replace(tzinfo=None) with Python 3.13
Roland Ernst
noreply at github.com
Sun Oct 5 17:18:20 UTC 2025
Branch: refs/heads/master
Home: https://github.com/MythTV/mythtv
Commit: fcb36c32d13f6a69e728bb8ede6d36f7d71c1fd3
https://github.com/MythTV/mythtv/commit/fcb36c32d13f6a69e728bb8ede6d36f7d71c1fd3
Author: Roland Ernst <rcrernst at gmail.com>
Date: 2025-10-05 (Sun, 05 Oct 2025)
Changed paths:
M mythtv/bindings/python/MythTV/utility/dt.py
Log Message:
-----------
Fix datetime.replace(tzinfo=None) with Python 3.13
Python 3.13 fixed [gh-89039]. Now `datetime.__new__()` is also
used for `datetime.replace()`, which is called with `tzinfo=None` to
convert a time-zone aware instance to a _naive_ instance. But
`__new__()` replaces `tzinfo=None` with `loczlTZ()`, which just re-adds
the offset back.
This breaks calling `database.update()` on all database records, which
use timestamps as a datetime with the wrong timezone offset is used.
Add a new singleton LTZ and use that instead of `tzinfo=None` to keep
the old behavior to get the local timezone by default.
Fixes: #1179
[gh-89039]: https://github.com/python/cpython/issues/89039
Many thanks to github user @pmhahn providing the patch.
To unsubscribe from these emails, change your notification settings at https://github.com/MythTV/mythtv/settings/notifications
More information about the mythtv-commits
mailing list