Closed
Description
Problem Statement
Python 3.12 deprecated datetime.datetime.utcnow()
:
.pyenv/lib/python3.12/site-packages/sentry_sdk/tracing.py:148: 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).
Solution Brainstorm
Update sentry to use datetime.datetime.now(datetime.UTC)
instead of datetime.datetime.utcnow()
as suggested.
Some quick testing shows that for this to work on python < 3.11 would have to do datetime.datetime.now(datetime.timezone.utc)
instead as the datetime.UTC
shortcut was only added in python 3.11
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status