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 DeprecationWarning: datetime.datetime.utcnow() #8726
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8726 +/- ##
==========================================
- Coverage 87.27% 87.24% -0.04%
==========================================
Files 148 148
Lines 18636 18637 +1
Branches 3199 3199
==========================================
- Hits 16265 16260 -5
- Misses 2078 2080 +2
- Partials 293 297 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
you can make it draft before the builds are passing
> lib/python3.12/site-packages/celery/app/base.py:940: 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). now_in_utc = to_utc(datetime.utcnow())
Please rebase to resolve the conflicts. |
Restarting CI, unrelated error |
great job! thanks a lot |
There is more |
A continuation of celery#8726 * celery#8726 % `python3.12` ``` >>> from datetime import datetime, timezone >>> datetime.now(timezone.utc).isoformat()[:-9], datetime.utcnow().isoformat()[:-3] <stdin>:1: 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). ('2023-12-19T21:15:19.935', '2023-12-19T21:15:19.935')
Description
Fix DeprecationWarning: datetime.datetime.utcnow() on Python 3.12
https://docs.python.org/3/library/datetime.html#datetime.datetime.utcnow