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

botocore using deprecated datetime.datetime.utcnow() call #3088

Closed
paulschreiber opened this issue Dec 18, 2023 · 2 comments · May be fixed by #3145
Closed

botocore using deprecated datetime.datetime.utcnow() call #3088

paulschreiber opened this issue Dec 18, 2023 · 2 comments · May be fixed by #3145
Labels
bug This issue is a confirmed bug. duplicate This issue is a duplicate.

Comments

@paulschreiber
Copy link

Describe the bug

botocore is using datetime.datetime.utcnow(), which is deprecated. It generates this warning:

 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).
    datetime_now = datetime.datetime.utcnow()

Expected Behavior

No warnings

Current Behavior

DeprecationWarning

Reproduction Steps

n/a

Possible Solution

Use datetime.datetime.now(datetime.UTC)

Additional Information/Context

No response

SDK version used

1.34.2

Environment details (OS name and version, etc.)

Python 3.12.0

@paulschreiber paulschreiber added bug This issue is a confirmed bug. needs-triage This issue or PR still needs to be triaged. labels Dec 18, 2023
@nateprewitt
Copy link
Contributor

Hi @paulschreiber,

Thanks for reaching out. We're currently tracking this in boto/boto3#3889. Unfortunately, this isn't as straight forward as replacing a function call. We already attempted this in 96ca907 when 3.12 support was released and needed to roll it back due to breaking date serialization changes.

We're currently looking at removing the warnings long term in a backwards compatible manner, but don't have a timeline to provide. The utcnow deprecation is currently slated sometime after Python 3.16, so it's at least few years out. We'll work on getting it addressed more timely.

Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

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
2 participants