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

Fix use of the deprecated datetime.utcnow method #1758

Merged
merged 1 commit into from
Sep 11, 2023

Conversation

mdickinson
Copy link
Member

@mdickinson mdickinson commented Sep 11, 2023

This PR replaces uses of the deprecated (as of Python 3.12) datetime.utcnow method. Note that this isn't quite a like-for-like change: there's a slight difference in the output format. Given that the event tracer is barely used in practice, I doubt this change matters much.

>>> from datetime import datetime, timezone
>>> datetime.now(timezone.utc).isoformat(" ")
'2023-09-11 16:31:35.534330+00:00'
>>> datetime.utcnow().isoformat(" ")
'2023-09-11 16:31:56.798474'

@rahulporuri rahulporuri self-requested a review September 11, 2023 16:57
@mdickinson mdickinson merged commit 36a95d5 into main Sep 11, 2023
27 checks passed
@mdickinson mdickinson deleted the fix/use-of-datetime-utcnow branch September 11, 2023 17:04
mdickinson added a commit that referenced this pull request Sep 11, 2023
This PR replaces uses of the deprecated (as of Python 3.12)
`datetime.utcnow` method. Note that this isn't quite a like-for-like
change: there's a slight difference in the output format. Given that the
event tracer is barely used in practice, I doubt this change matters
much.

```
>>> from datetime import datetime, timezone
>>> datetime.now(timezone.utc).isoformat(" ")
'2023-09-11 16:31:35.534330+00:00'
>>> datetime.utcnow().isoformat(" ")
'2023-09-11 16:31:56.798474'
```

(cherry picked from commit 36a95d5)
@mdickinson mdickinson mentioned this pull request Sep 11, 2023
mdickinson added a commit that referenced this pull request Oct 9, 2023
This PR:

- backports PR #1755 to the release branch
- updates the version and changelog in preparation for a Traits 6.4.3
release

EDIT: Updated 2023-09-11 to backport PRs #1757  and #1758.
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.

2 participants