Skip to content

Fix Python 3.12 DeprecationWarning: datetime.datetime.utcfromtimestamp()#2848

Merged
j9ac9k merged 3 commits intopyqtgraph:masterfrom
bersbersbers:fix-#2847
Oct 30, 2023
Merged

Fix Python 3.12 DeprecationWarning: datetime.datetime.utcfromtimestamp()#2848
j9ac9k merged 3 commits intopyqtgraph:masterfrom
bersbersbers:fix-#2847

Conversation

@bersbersbers
Copy link
Copy Markdown
Contributor

utcfromtimestamp() is deprecated in Python 3.12. Fixes #2847.

@bersbersbers bersbersbers changed the title Fix #2847 Fix Python 3.12 DeprecationWarning: datetime.datetime.utcfromtimestamp() Oct 18, 2023
@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Oct 29, 2023

Thanks for the PR @bersbersbers !

Is there a reason we can't remove the platform specific if-statement and just use datetime.fromtimestamp(0, timezone.utc) ?

@bersbersbers
Copy link
Copy Markdown
Contributor Author

Is there a reason we can't remove the platform specific if-statement and just use datetime.fromtimestamp(0, timezone.utc) ?

I haven't tried, to be honest. The platform-specific code was there before, and in an effort to affect as little code as possible while on my phone, I did not touch that part.

@bersbersbers
Copy link
Copy Markdown
Contributor Author

(But feel free to edit/take over this PR.)

@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Oct 30, 2023

Taking a closer look, there could definitely be some room for cleanup; but that would involve a change that's far outside the scope of removing a deprecated method such as this PR aims to do.

This LGTM, thanks for the PR @bersbersbers !

@j9ac9k j9ac9k merged commit 48d1314 into pyqtgraph:master Oct 30, 2023
@bersbersbers bersbersbers deleted the fix-#2847 branch October 30, 2023 16:03
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.

Python 3.12 DeprecationWarning: datetime.datetime.utcfromtimestamp()

2 participants