Bug 291348
| Summary: | [webkitpy] DeprecationWarning: datetime.utcnow() and datetime.datetime.utcfromtimestamp() | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Fujii Hironori <fujii> |
| Component: | Tools / Tests | Assignee: | Fujii Hironori <fujii> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=291303 | ||
Fujii Hironori
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Fujii Hironori
Pull request: https://github.com/WebKit/WebKit/pull/43880
Radar WebKit Bug Importer
<rdar://problem/149435408>
EWS
Committed 294023@main (4d1af55b74c9): <https://commits.webkit.org/294023@main>
Reviewed commits have been landed. Closing PR #43880 and removing active labels.