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

remove calls to utcnow and utcfromtimestamp #3335

Conversation

graingert
Copy link
Contributor

@graingert graingert commented Oct 3, 2023

#3288 fixed most of these but some remained

@bdarnell
Copy link
Member

datetime.datetime.fromtimestamp(x, datetime.timezone.utc).replace(tzinfo=None) is a non-deprecated way to do what we were doing before, but it goes against the spirit of the deprecation. In #3288 I fixed this by using aware datetimes in most cases instead of trying to continue to use naive ones. I think we want to do the same here (and get rid of all the replace(tzinfo=None) calls). But I know this is untested code (or it would have been caught already), so I'm a little wary of touching it. Did you find that these replace() calls were necessary or were you just trying to preserve the original semantics?

bdarnell added a commit to bdarnell/tornado that referenced this pull request Nov 2, 2023
Add a simple test case to give us some basic coverage of this
code path.

Closes tornadoweb#3335
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