Open azliu0 opened 3 months ago
Is this issue resolved? We are still getting when we upgrade python to 3.12 DeprecationWarning: datetime.datetime.utcnow() is dep recated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC). datetime_now = datetime.datetime.utcnow()
It would be wonderful if this could get reviewed and merged. We're getting a mountain of deprecation warnings from our tests because of this. Thanks for the work @azliu0
Resolves #3088, which is currently being tracked in boto/boto3#3889.
It looks like this change was attempted in #3003, but was reverted after #3077 in #3004. These changes differ from #3003 by also addressing the conversion issues brought up in #3077, ensuring that all datetime objects are timezone aware.
These changes further improve on the changes in #3003 by mocking out
.now
with a factory, rather than hard-coding the return to be theutc
value only. This is closer to the actual functionality of.now
, which is a function that takes timezone as input (but defaults toutc
).All unit and functional tests pass locally, with the exception of
functional/test_resource_leaks.py
, which does not pass for me locally before the change.