Repository navigation
datetime.datetime.utcnow() is deprecated #2407
Copy link
Copy link
Closed
Milestone
Description
Activity
- moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀
on 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!
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:
- fork the
getsentry/sentry-pythonrepo - clone the forked repo to work on it locally
- push a new branch with the changes to your fork
- and finally open a PR from your fork (and your branch) against this repo's master branch
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!
Reacted by Sourav- fork the
- moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀
on Oct 4, 2023 - linked a pull request that will close this issueRemoving utcnow method deprecated at python3.12 #2415
on Oct 5, 2023
Metadata
Metadata
Assignees
Labels
No labels
Projects
- StatusShow more project fieldsNo status
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.UTCshortcut was only added in python 3.11