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 deprecated utcnow() calls with now(timezone.utc) #788

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

shreddd
Copy link
Collaborator

@shreddd shreddd commented Nov 21, 2024

Fix to address deprecated datetime.utcnow() calls

Copy link
Collaborator

@eecavanna eecavanna left a comment

Choose a reason for hiding this comment

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

I see the deprecation notice in the Python 3 docs:

image

The changes in this branch are consistent with "the recommended way" shown in the red box on that page.

@eecavanna eecavanna changed the title Update to the newer syntax for getting utcnow() Replace deprecated utcnow() calls with now(timezone.utc) (recommended in Python docs) Nov 22, 2024
@eecavanna
Copy link
Collaborator

I confirmed that, even in the Python 3.10 docs, this replacement is "recommended."

image

The reason I checked that version of the Python docs is that that is the Python version that is running in the container image that runs the FastAPI app, according to its Dockerfile.

@eecavanna eecavanna changed the title Replace deprecated utcnow() calls with now(timezone.utc) (recommended in Python docs) Replace deprecated utcnow() calls with now(timezone.utc) Nov 23, 2024
@eecavanna
Copy link
Collaborator

I'm comfortable with this branch being merged into main as is.

Copy link
Collaborator

@dwinston dwinston left a comment

Choose a reason for hiding this comment

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

Great. Thanks.

@dwinston dwinston merged commit 391fe7b into main Nov 25, 2024
2 checks passed
@dwinston dwinston deleted the fix-deprecated-utcnow branch November 25, 2024 12:00
dwinston added a commit that referenced this pull request Nov 26, 2024
…ur with `refscan` (no false positives) (#796)

* todo: progress

* todo: progress

* fix: ThreadPoolExecutor is evil?

closes #576

* Drop the old tests2 dir

* Update to the newer syntax for getting utcnow() (#788)

* Add "Translators" subsystem as option in PR template (#767)

* Remove reference to nonexistent `tests2` directory

---------

Co-authored-by: shreddd <[email protected]>
Co-authored-by: Shreyas Cholia <[email protected]>
Co-authored-by: eecavanna <[email protected]>
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.

3 participants