You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the incorrect behavior you saw datetime.datetime.utcnow and datetime.datetime.utcfromtimestamp raise deprecation warnings in Python 3.12.
Describe how to cause this behavior
While running trial on buildbot this generates lots of deprecation warnings like:
Traceback (most recent call last):
File "C:\P\twisted\src\twisted\logger\_observer.py", line 81, in __call__
observer(event)
File "C:\P\twisted\src\twisted\logger\_legacy.py", line 90, in __call__
self.legacyObserver(event)
File "C:\P\twisted\src\twisted\python\log.py", line 544, in emit
timeStr = self.formatTime(eventDict["time"])
File "C:\P\twisted\src\twisted\python\log.py", line 514, in formatTime
tzOffset = -self.getTimezoneOffset(when)
File "C:\P\twisted\src\twisted\python\log.py", line 493, in getTimezoneOffset
offset = datetime.utcfromtimestamp(when) - datetime.fromtimestamp(when)
builtins.DeprecationWarning: datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.fromtimestamp(timestamp, datetime.UTC).
E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Running buildbot trial with current HEAD & current trunk of twisted.
Describe the correct behavior you'd like to see
No deprecation warning reported while running trial under python 3.12.
Testing environment
Operating System and Version; paste the output of these commands:
OS Name: Microsoft Windows 11 Home
OS Version: 10.0.22621 N/A Build 22621
OS Manufacturer: Microsoft Corporation
OS Configuration: Standalone Workstation
OS Build Type: Multiprocessor Free
System Manufacturer: Microsoft Corporation
BIOS Version: Microsoft Corporation 15.11.140, 8. 7. 2022
Describe the incorrect behavior you saw
datetime.datetime.utcnow
anddatetime.datetime.utcfromtimestamp
raise deprecation warnings in Python 3.12.Describe how to cause this behavior
While running trial on buildbot this generates lots of deprecation warnings like:
Running buildbot trial with current HEAD & current trunk of twisted.
Describe the correct behavior you'd like to see
No deprecation warning reported while running trial under python 3.12.
Testing environment
22.10.0.post0
a9ee8e5
twisted-iocpsupport 1.0.4
Additional context
utcnow
andutcfromtimestamp
python/cpython#103857The text was updated successfully, but these errors were encountered: