From 8c2493715c693058e75828990d914c25271787fc Mon Sep 17 00:00:00 2001 From: Alex Dempsey Date: Tue, 4 Mar 2025 13:51:07 -0800 Subject: [PATCH] Make tz-aware datetime of the epoch with stdlib --- brozzler/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/brozzler/__init__.py b/brozzler/__init__.py index 7798e5f..6916bb4 100644 --- a/brozzler/__init__.py +++ b/brozzler/__init__.py @@ -321,10 +321,9 @@ def _remove_query(url): # XXX chop off path after last slash?? site_surt_canon = urlcanon.Canonicalizer(urlcanon.semantic.steps + [_remove_query]) -import doublethink import datetime -EPOCH_UTC = datetime.datetime.utcfromtimestamp(0.0).replace(tzinfo=doublethink.UTC) +EPOCH_UTC = datetime.datetime.fromtimestamp(0.0, tz=datetime.timezone.utc) # we could make this configurable if there's a good reason MAX_PAGE_FAILURES = 3