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
.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
Activity
sentrivana commentedon Oct 3, 2023
Good catch @grigi! I've added this to the list of things we should tackle in order to support 3.12.
If you or anyone reading this feels like it, PRs are very welcome!
mohebmithani commentedon Oct 3, 2023
Hi @sentrivana can i take this?
rmad17 commentedon Oct 4, 2023
I made the changes, but unfortunately, realized after that I could not push the code to a new branch. What is the process to open a PR?
sentrivana commentedon Oct 4, 2023
Hey @mohebmithani, no need to ask, feel free to just submit a PR! But seems like @rmad17 already has a solution for this issue.
Awesome @rmad17! The gist is that you need to make the changes on a fork of this repo:
getsentry/sentry-pythonrepoWe should do a better job outlining this in our CONTRIBUTING.md -- I will look into that. Let me know if you need more pointers!