saltstack/salt

[TECH DEBT] datetime.datetime.utcnow() is deprecated in Python 3.12

Open

#65,604 opened on Nov 23, 2023

View on GitHub
 (2 comments) (2 reactions) (0 assignees)Python (13,710 stars) (5,508 forks)batch import
good first issuetech-debt

Description

Description of the tech debt to be addressed, include links and screenshots

Using salt-ssh results in the following warning:

/usr/lib/python3.12/site-packages/salt/utils/jid.py:19: 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).

Versions Report

(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)

This is salt-ssh called from/to Fedora 39

Salt Version:
          Salt: 3006.4
 
Python Version:
        Python: 3.12.0 (main, Oct  2 2023, 00:00:00) [GCC 13.2.1 20230918 (Red Hat 13.2.1-3)]
 
Dependency Versions:
          cffi: 1.15.1
      cherrypy: Not Installed
      dateutil: 2.8.2
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.2
       libgit2: Not Installed
  looseversion: 1.3.0
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.5
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     packaging: 23.1
     pycparser: 2.20
      pycrypto: Not Installed
  pycryptodome: 3.19.0
        pygit2: Not Installed
  python-gnupg: Not Installed
        PyYAML: 6.0.1
         PyZMQ: 25.1.0
        relenv: Not Installed
         smmap: Not Installed
       timelib: Not Installed
       Tornado: 6.3.3
           ZMQ: 4.3.4
 
System Versions:
          dist: fedora 39 
        locale: utf-8
       machine: x86_64
       release: 6.5.10-1.qubes.fc37.x86_64
        system: Linux
       version: Fedora Linux 39 

Contributor guide