-
Notifications
You must be signed in to change notification settings - Fork 520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
datetime.datetime.utcnow() is deprecated #2407
Comments
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! |
Hi @sentrivana can i take this? |
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? |
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:
We should do a better job outlining this in our CONTRIBUTING.md -- I will look into that. Let me know if you need more pointers! |
Problem Statement
Python 3.12 deprecated
datetime.datetime.utcnow()
:Solution Brainstorm
Update sentry to use
datetime.datetime.now(datetime.UTC)
instead ofdatetime.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 thedatetime.UTC
shortcut was only added in python 3.11The text was updated successfully, but these errors were encountered: