From: Bastian Germann <bage@debian.org>
To: linux-xfs@vger.kernel.org
Cc: Bastian Germann <bage@debian.org>
Subject: [PATCH] xfs_scrub_all: Replace deprecated datetime.utcnow
Date: Sun, 31 Aug 2025 22:25:15 +0200 [thread overview]
Message-ID: <20250831202547.2407-1-bage@debian.org> (raw)
Python 3.12 has deprecated datetime.datetime.utcnow. Replace it with
datetime.datetime.now with timezone object.
Closes: #1112588
Signed-off-by: Bastian Germann <bage@debian.org>
---
scrub/xfs_scrub_all.py.in | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/scrub/xfs_scrub_all.py.in b/scrub/xfs_scrub_all.py.in
index 515cc144..a94b1b71 100644
--- a/scrub/xfs_scrub_all.py.in
+++ b/scrub/xfs_scrub_all.py.in
@@ -496,8 +496,7 @@ def scan_interval(string):
def utcnow():
'''Create a representation of the time right now, in UTC.'''
- dt = datetime.utcnow()
- return dt.replace(tzinfo = timezone.utc)
+ return datetime.now(timezone.utc)
def enable_automatic_media_scan(args):
'''Decide if we enable media scanning automatically.'''
reply other threads:[~2025-08-31 20:25 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250831202547.2407-1-bage@debian.org \
--to=bage@debian.org \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.