Skip to content
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

datetime.datetime.utcnow() is deprecated as of Python 3.12 #3201

Closed
eduardo-boutiquenumerique opened this issue Jun 9, 2024 · 2 comments
Closed
Assignees
Labels
bug This issue is a confirmed bug. duplicate This issue is a duplicate.

Comments

@eduardo-boutiquenumerique

Describe the bug

The module botocore.auth.py uses the function datetime.datetime.utcnow() which is depreacated and throws the 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).

Expected Behavior

The warning should not be raised

Current Behavior

The DeprecationWarning is being raised

Reproduction Steps

Using last versions botocore and launching python with options -Wa raises the warning

Possible Solution

Replace datetime.datetime.utcnow() with datetime.datetime.now(datetime.UTC) as described in the warning itself

Additional Information/Context

No response

SDK version used

1.34.122

Environment details (OS name and version, etc.)

linux, ubunut

@eduardo-boutiquenumerique eduardo-boutiquenumerique added bug This issue is a confirmed bug. needs-triage This issue or PR still needs to be triaged. labels Jun 9, 2024
@tim-finnigan tim-finnigan self-assigned this Jun 11, 2024
@tim-finnigan tim-finnigan added the investigating This issue is being investigated and/or work is in progress to resolve the issue. label Jun 11, 2024
@tim-finnigan
Copy link
Contributor

This is a duplicate of boto/boto3#3889. As mentioned there:

The team is aware of this issue and working on addressing the warnings. These deprecations won't cause impact currently beyond the warnings. The required changes are not fully backwards compatible for existing usage. We'll be prioritizing a more robust fix in an upcoming release.

Closing to continue tracking in that issue.

@tim-finnigan tim-finnigan closed this as not planned Won't fix, can't repro, duplicate, stale Jun 11, 2024
@tim-finnigan tim-finnigan added duplicate This issue is a duplicate. and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. needs-triage This issue or PR still needs to be triaged. labels Jun 11, 2024
Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a confirmed bug. duplicate This issue is a duplicate.
Projects
None yet
Development

No branches or pull requests

2 participants