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

Replace usage of deprecated datetime.utcnow() with datetime.now(UTC) #360

Merged
merged 5 commits into from
Feb 13, 2025

Conversation

iamdhakrey
Copy link
Contributor

Python 3.12 deprecates datetime.utcnow() in favor of using timezone-aware objects like datetime.now(UTC). This commit updates the codebase accordingly to align with the latest recommendations.

https://docs.python.org/3/library/datetime.html#datetime.datetime.utcnow

Copy link

@tgwizard tgwizard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just started encountering this after upgrading Python.

@asherf
Copy link
Collaborator

asherf commented Feb 6, 2025

not sure why CI is not running for this.

@iamdhakrey iamdhakrey requested review from tgwizard and asherf February 7, 2025 13:34
@iamdhakrey
Copy link
Contributor Author

iamdhakrey commented Feb 10, 2025

Why pipelines were not running?

@asherf
Copy link
Collaborator

asherf commented Feb 10, 2025

Why pipelines were not running?

Very strange. Can you try to re-push ?

Refactor datetime imports and usage to ensure compatibility with Python 3.12 and 3.13. Replace deprecated datetime.utcnow() with datetime.now(UTC) and handle ImportError for older versions.
- Replace deprecated datetime.utcnow() with datetime.now(UTC) for better compatibility.
- Adjusted import statements and usage in jwt.py and test_jwt.py for consistency.
@asherf asherf merged commit 0360fa3 into mpdavis:master Feb 13, 2025
15 checks passed
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.

None yet

3 participants