diff --git a/f2293200747fb03d56c6c5997bfebeabe703576f.patch b/f2293200747fb03d56c6c5997bfebeabe703576f.patch new file mode 100644 index 0000000..c4ebe23 --- /dev/null +++ b/f2293200747fb03d56c6c5997bfebeabe703576f.patch @@ -0,0 +1,23 @@ +From f2293200747fb03d56c6c5997bfebeabe703576f Mon Sep 17 00:00:00 2001 +From: Thomas Grainger +Date: Fri, 2 Jun 2023 14:06:41 +0100 +Subject: [PATCH] avoid deprecated utcfromtimestamp + +Fixes #1284 +--- + src/dateutil/tz/tz.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/dateutil/tz/tz.py b/src/dateutil/tz/tz.py +index c67f56d46..617591446 100644 +--- a/src/dateutil/tz/tz.py ++++ b/src/dateutil/tz/tz.py +@@ -34,7 +34,7 @@ + from warnings import warn + + ZERO = datetime.timedelta(0) +-EPOCH = datetime.datetime.utcfromtimestamp(0) ++EPOCH = datetime.datetime(1970, 1, 1, 0, 0) + EPOCHORDINAL = EPOCH.toordinal() + + diff --git a/python-dateutil.spec b/python-dateutil.spec index 4b59fce..28bab15 100644 --- a/python-dateutil.spec +++ b/python-dateutil.spec @@ -2,7 +2,7 @@ Name: python-%{modname} Version: 2.8.2 -Release: 8%{?dist} +Release: 9%{?dist} Epoch: 1 Summary: Powerful extensions to the standard datetime module @@ -22,6 +22,10 @@ Source: %{pypi_source} # https://bugzilla.redhat.com/show_bug.cgi?id=2059950 Patch1: %{url}/commit/2bdd63158b7f981fc6d70a869680451bdfd8d848.patch +# Backport the replacement for the deprecated in Python 3.12 +# datetime.datetime.utcfromtimestamp() +Patch2: %{url}/commit/f2293200747fb03d56c6c5997bfebeabe703576f.patch + # when bootstrapping dateutil-freezegun, we cannot run tests # on RHEL, we do not have or want all test dependencies %bcond tests %{undefined rhel} @@ -66,6 +70,7 @@ This package contains %{summary}. pushd %{modname}/test %patch1 -p2 popd +%patch2 -p2 iconv --from=ISO-8859-1 --to=UTF-8 NEWS > NEWS.new mv NEWS.new NEWS @@ -94,6 +99,9 @@ make -C docs html %doc docs/_build/html %changelog +* Tue Jul 04 2023 Karolina Surma - 1:2.8.2-9 +- Backport replacement for deprecated datetime.datetime.utcfromtimestamp() + * Fri Jun 16 2023 Python Maint - 1:2.8.2-8 - Rebuilt for Python 3.12