Skip to content

kstat-analyzer DeprecationWarning: datetime.datetime.utcnow() #5

@stevecs

Description

@stevecs

just updated one of my zfs servers to ubuntu 24.04

uname -a

Linux loki 6.8.0-53-generic #55-Ubuntu SMP PREEMPT_DYNAMIC Fri Jan 17 15:37:52 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

and see that with the version of python3 on the system ( python3 3.12.3-0ubuntu2 ) is throwing a deprecation warning when running the script:

`

./kstat-analyzer

################################
ZFS on Linux Statistics Analyzer
################################
/usr/local/src/git-repos/zfs-linux-tools/./kstat-analyzer:80: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
print('Analysis date = {}Z'.format(datetime.utcnow().isoformat()))
Analysis date = 2025-02-11T23:51:42.045204Z
Analyzer version = 0.7.9
Directories analyzed: /proc/spl
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions