Skip to content

Replace deprecated datetime.utcnow() in AWS MSK IAM client - #3156

Open
utku0dogan wants to merge 1 commit into
dpkp:masterfrom
utku0dogan:fix/msk-utcnow-deprecation
Open

Replace deprecated datetime.utcnow() in AWS MSK IAM client#3156
utku0dogan wants to merge 1 commit into
dpkp:masterfrom
utku0dogan:fix/msk-utcnow-deprecation

Conversation

@utku0dogan

Copy link
Copy Markdown

PR Title:

net/sasl: Replace deprecated datetime.utcnow() with datetime.now(timezone.utc)

PR Description:

Python 3.12+ deprecates datetime.datetime.utcnow() in favor of timezone-aware UTC datetimes.

This PR:

  • Replaces datetime.datetime.utcnow() with datetime.datetime.now(datetime.timezone.utc) in kafka/net/sasl/msk.py.
  • Updates test/net/sasl/test_msk.py to match the new signature and removes the obsolete Python 3.3 check.

All tests in test/net/sasl/test_msk.py pass with zero warnings (-W error::Warning).

In Python 3.12+, datetime.datetime.utcnow() is deprecated and scheduled for removal. Replace with datetime.datetime.now(datetime.timezone.utc) and update corresponding unit tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant