linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfs_scrub_all: Replace deprecated datetime.utcnow
@ 2025-08-31 20:25 Bastian Germann
  0 siblings, 0 replies; only message in thread
From: Bastian Germann @ 2025-08-31 20:25 UTC (permalink / raw)
  To: linux-xfs; +Cc: Bastian Germann

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.'''

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-08-31 20:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-31 20:25 [PATCH] xfs_scrub_all: Replace deprecated datetime.utcnow Bastian Germann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).