From 0ad472612f6268ab926120a3b5fb3c1dc97ab8ad Mon Sep 17 00:00:00 2001 From: Miro <200482516+Mirochill@users.noreply.github.com> Date: Mon, 25 May 2026 10:16:44 +0200 Subject: [PATCH] Avoid deprecated utcfromtimestamp in cache headers --- update-zonefile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/update-zonefile.py b/update-zonefile.py index f2094fb..0f08508 100755 --- a/update-zonefile.py +++ b/update-zonefile.py @@ -24,7 +24,7 @@ import requests from pathlib import Path -from datetime import datetime +from datetime import datetime, timezone import email.utils as eut import os import hashlib @@ -67,7 +67,7 @@ def download_list(url): cache = Path(config['cache'], hashlib.sha1(url.encode()).hexdigest()) if cache.is_file(): - last_modified = datetime.utcfromtimestamp(cache.stat().st_mtime) + last_modified = datetime.fromtimestamp(cache.stat().st_mtime, tz=timezone.utc) headers = { 'If-modified-since': eut.format_datetime(last_modified), 'User-Agent': 'Bind adblock zonfile updater v1.0 (https://github.com/Trellmor/bind-adblock)'