-
Notifications
You must be signed in to change notification settings - Fork 43
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
fix: Replace deprecated datetime.utcnow() with timezone-aware alterna… #652
Conversation
…tive Replaced instances of datetime.datetime.utcnow() with datetime.datetime.now(datetime.UTC) to address deprecation warnings in Python 3.12+. Signed-off-by: AnsahMohammad <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the patch.
You'll need to use datetime.timezone.utc, as datetime.UTC was only added in python 3.11.
Signed-off-by: AnsahMohammad <[email protected]>
Just did that, please check now |
@jcristau Hey, I noticed that the |
Sounds like a good idea, yes :) |
I went through the codebase and found this :
This made the test case miss the time-format issue on tests. I am not sure if it'll be a good idea to replace the "pass" statement here as any error might break the flow. I am confused on how to proceed. |
@AnsahMohammad I've pushed a commit to your branch to add a test and fix the issue that was breaking the decision task. |
Thanks for the commit 👍. |
Updated to pull in #659 and trigger the required |
Added the "breaking change" label because both |
Replaced instances of datetime.datetime.utcnow() with datetime.datetime.now(datetime.UTC) to address deprecation warnings while running pytest.