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

refactor: replace deprecated utcfromtimestamp function #2700

Merged

Conversation

tdadela
Copy link
Contributor

@tdadela tdadela commented May 5, 2024

Replace deprecated datetime.datetime.utcfromtimestamp function with datetime.datetime.fromtimestamp.
See datetime.datetime.utcfromtimestamp docs:

Warning: Because naive datetime objects are treated by many datetime methods as local times, it is preferred to use aware datetimes to represent times in UTC. As such, the recommended way to create an object representing a specific timestamp in UTC is by calling datetime.fromtimestamp(timestamp, tz=timezone.utc).

Deprecated since version 3.12: Use datetime.fromtimestamp() with UTC instead.

It currently generates warning in Locust CI.

@cyberw cyberw merged commit a04ab14 into locustio:master May 5, 2024
14 checks passed
@tdadela tdadela deleted the replace-utcfromtimestamp-with-fromtimestamp branch May 5, 2024 18:41
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.

None yet

2 participants