fix: Replace deprecated datetime.utcnow() with timezone-aware alterna…#652
fix: Replace deprecated datetime.utcnow() with timezone-aware alterna…#652ahal merged 7 commits intotaskcluster:mainfrom
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 <mohdansah10@gmail.com>
jcristau
left a comment
There was a problem hiding this comment.
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 <mohdansah10@gmail.com>
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.