RESOLVED FIXED291348
[webkitpy] DeprecationWarning: datetime.utcnow() and datetime.datetime.utcfromtimestamp()
https://bugs.webkit.org/show_bug.cgi?id=291348
Summary [webkitpy] DeprecationWarning: datetime.utcnow() and datetime.datetime.utcfro...
Fujii Hironori
Reported 2025-04-09 18:25:52 PDT
datetime.utcnow() and datetime.utcfromtimestamp(timestamp) are deprecated since Python 3.12. By setting PYTHONWARNINGS=module, test-webkitpy report some DeprecationWarning. For example, > [1609/2144] webkitscmpy.test.clone_unittest.TestClone.test_no_radar passedC:\webkit\wc\Tools\Scripts\libraries\webkitscmpy\webkitscmpy\commit.py:269: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC). > result += ' @ {}'.format(datetime.utcfromtimestamp(self.timestamp)) > C:\webkit\wc\Tools\Scripts\libraries\webkitscmpy\webkitscmpy\test\commit_unittest.py:130: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC). > '''.format(datetime.utcfromtimestamp(1000)),
Attachments
Fujii Hironori
Comment 1 2025-04-09 18:27:31 PDT
Radar WebKit Bug Importer
Comment 2 2025-04-16 18:26:16 PDT
EWS
Comment 3 2025-04-23 15:05:46 PDT
Committed 294023@main (4d1af55b74c9): <https://commits.webkit.org/294023@main> Reviewed commits have been landed. Closing PR #43880 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.