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

Core: fix deprecation warning in for utcnow() #4170

Merged
merged 4 commits into from
Nov 29, 2024

Conversation

Berserker66
Copy link
Member

What is this fixing or adding?

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

How was this tested?

running setup.py build_exe on py 3.12

If this makes graphical changes, please attach screenshots.

@github-actions github-actions bot added affects: core Issues/PRs that touch core and may need additional validation. waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. labels Nov 11, 2024
@black-sliver black-sliver added this to the Archipelago 0.6.0 milestone Nov 18, 2024
@ScipioWright ScipioWright added the waiting-on: other Issue/PR is waiting for something else, like another PR. label Nov 19, 2024
Copy link
Contributor

@nicholassaylor nicholassaylor left a comment

Choose a reason for hiding this comment

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

LGTM, this should work now that 3.8 is binned

setup.py Outdated Show resolved Hide resolved
Co-authored-by: Nicholas Saylor <[email protected]>
setup.py Outdated Show resolved Hide resolved
Co-authored-by: Nicholas Saylor <[email protected]>
Copy link
Member

@black-sliver black-sliver left a comment

Choose a reason for hiding this comment

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

>>> from datetime import datetime, timezone
>>> datetime.utcnow().hour == datetime.now(timezone.utc).hour
True

@Berserker66 Berserker66 merged commit b972e8c into main Nov 29, 2024
18 checks passed
@Berserker66 Berserker66 deleted the core_setup_utcnow_deprecate branch November 29, 2024 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects: core Issues/PRs that touch core and may need additional validation. waiting-on: other Issue/PR is waiting for something else, like another PR. waiting-on: peer-review Issue/PR has not been reviewed by enough people yet.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants