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

py3.12: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal #3334

Closed
graingert opened this issue Oct 3, 2023 · 4 comments

Comments

@graingert
Copy link
Contributor

traceback:

HTTPServerRequest(protocol='https', host='localhost:46611', method='GET', uri='/statics/individual-cluster-map.html', version='HTTP/1.1', remote_ip='127.0.0.1')
Traceback (most recent call last):
  File "/home/graingert/mambaforge/envs/dask-distributed-312/lib/python3.12/site-packages/tornado/web.py", line 1786, in _execute
    result = await result
             ^^^^^^^^^^^^
  File "/home/graingert/mambaforge/envs/dask-distributed-312/lib/python3.12/site-packages/tornado/web.py", line 2688, in get
    self.modified = self.get_modified_time()
                    ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/graingert/mambaforge/envs/dask-distributed-312/lib/python3.12/site-packages/tornado/web.py", line 2994, in get_modified_time
    modified = datetime.datetime.utcfromtimestamp(int(stat_result.st_mtime))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
@graingert
Copy link
Contributor Author

it looks like some of these were fixed in #3288

@bdarnell
Copy link
Member

bdarnell commented Oct 3, 2023

Yes, this will be fixed with tornado 6.4 as soon as I can figure out what's going on with some windows CI failures.

@graingert
Copy link
Contributor Author

ah I see the one in the traceback was fixed in #3288 but a grep found some that aren't covered by the test suite

@bdarnell
Copy link
Member

bdarnell commented Nov 7, 2023

Fixed these in #3341 (and added a new test)

@bdarnell bdarnell closed this as completed Nov 7, 2023
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

No branches or pull requests

2 participants