mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-10-25 22:50:12 -05:00
python 3.12: utcnow function is deprecated
The following warning is displayed on a system running with Python 3.12: ------------------- /usr/lib/python3.12/site-packages/ipalib/rpc.py:925: DeprecationWarning: datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.now(datetime.UTC). timestamp=datetime.datetime.utcnow()) ------------------- Fixes: https://pagure.io/freeipa/issue/9425 Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com> Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
This commit is contained in:
1 parent
bbb53a1271
commit
09497d2df0
15 files changed
+36
-31
No files matched your search
@@ -402,7 +402,7 @@ class TestHTTPReturn:
|
||||
assert cookie.http_return_ok(self.url)
|
||||
|
||||
def test_expires(self):
|
||||
now = datetime.datetime.utcnow().replace(microsecond=0)
|
||||
now = datetime.datetime.now(tz=datetime.UTC).replace(microsecond=0)
|
||||
|
||||
# expires 1 day from now
|
||||
expires = now + datetime.timedelta(days=1)
|
||||
|
||||
Reference in new issue
Block a user