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

[#384] Stop using datetime.utcfromtimestamp() on 3.12+ #385

Closed
wants to merge 1 commit into from

Conversation

slothkong
Copy link

Resolves #384

@@ -140,7 +140,10 @@ def convert_time(self, timestamp):
"""Converts the UNIX timestamp of the old record into a
datetime object as used by logbook.
"""
return datetime.utcfromtimestamp(timestamp)
if sys.version_info >= (3, 12):
return datetime.fromtimestamp(timestamp, tz=timezone.utc)
Copy link
Collaborator

Choose a reason for hiding this comment

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

this function needs to return a naive datetime

@RazerM
Copy link
Collaborator

RazerM commented Oct 21, 2024

Handling in #392

@RazerM RazerM closed this Oct 21, 2024
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.

Use of datetime.utcfromtimestamp() on 3.12+ is also deprecated
2 participants