From 12e80893f18c1a73c7360ae22fb69c0a13bf3605 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 10 Jun 2023 15:49:33 +0300 Subject: [PATCH] Use aware timezone internally in timestamped formatting Avoids using `datetime.utcfromtimestamp`, deprecated since Python 3.12. --- jaraco/logging.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/jaraco/logging.py b/jaraco/logging.py index c2217ff..f505016 100644 --- a/jaraco/logging.py +++ b/jaraco/logging.py @@ -1,7 +1,6 @@ import os import logging import time -import datetime import string import http.client @@ -133,7 +132,7 @@ def get_filename(self, t): if self._period_seconds: t -= t % self._period_seconds # convert it to a datetime object for formatting - dt = datetime.datetime.utcfromtimestamp(t) + dt = tempora.utc.fromtimestamp(t) # append the datestring to the filename # workaround for datetime.strftime not handling '' properly appended_date = (