Skip to content

Commit d56fb07

Browse files
authored
Merge branch 'deprecated-utcfromtimestamp' of 'https://github.com/jjmerchante/grimoirelab-toolkit'
Merges #60 Closes #60
2 parents ba5fb42 + 538cd12 commit d56fb07

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

grimoirelab_toolkit/datetime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def unixtime_to_datetime(ut):
175175
converted into a valid date
176176
"""
177177
try:
178-
dt = datetime.datetime.utcfromtimestamp(ut)
178+
dt = datetime.datetime.fromtimestamp(ut, datetime.timezone.utc)
179179
dt = dt.replace(tzinfo=dateutil.tz.tzutc())
180180
return dt
181181
except Exception:

poetry.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ classifiers = [
4040
python = "^3.9"
4141
python-dateutil = "^2.8.2"
4242

43-
[tool.poetry.dev-dependencies]
43+
[tool.poetry.group.dev.dependencies]
4444
flake8 = "^7.1.1"
4545
coverage = "^7.2.3"
4646

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Deprecated utcfromtimestamp updated
3+
category: fixed
4+
author: Jose Javier Merchante <jjmerchante@bitergia.com>
5+
issue: null
6+
notes: >
7+
Class method `utcfromtimestamp` was deprecated in Python 3.12
8+
and it recommends using `fromtimestamp` with UTC instead.

0 commit comments

Comments
 (0)