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

module 'datetime' has no attribute 'UTC' #302

Closed
rcritten opened this issue Sep 28, 2023 · 0 comments · Fixed by #303
Closed

module 'datetime' has no attribute 'UTC' #302

rcritten opened this issue Sep 28, 2023 · 0 comments · Fixed by #303
Assignees

Comments

@rcritten
Copy link
Collaborator

Sister issue to https://pagure.io/freeipa/issue/9454

In commit e05903d we stopped using utcnow() because it is deprecated and used datatime.UTC instead. This was introduced in python 3.11 so doesn't work with older releases.

Use datetime.timezone.utc instead which is more universal. datetime.UTC is an alias to datetime.timezone.utc.

@rcritten rcritten self-assigned this Sep 28, 2023
rcritten added a commit to rcritten/freeipa-healthcheck that referenced this issue Sep 28, 2023
We switched to datetime.UTC because datetime.utcnow() was deprecated.
This is only available in python 3.11+. Use datetime.timezone.utc
instead which is available from python 3.2+

Fixes: freeipa#302

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
rcritten added a commit to rcritten/freeipa-healthcheck that referenced this issue Sep 29, 2023
We switched to datetime.UTC because datetime.utcnow() was deprecated.
This is only available in python 3.11+. Use datetime.timezone.utc
instead which is available from python 3.2+

Fixes: freeipa#302

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
rcritten added a commit to rcritten/freeipa-healthcheck that referenced this issue Oct 13, 2023
We switched to datetime.UTC because datetime.utcnow() was deprecated.
This is only available in python 3.11+. Use datetime.timezone.utc
instead which is available from python 3.2+

Fixes: freeipa#302

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
rcritten added a commit to rcritten/freeipa-healthcheck that referenced this issue Oct 16, 2023
We switched to datetime.UTC because datetime.utcnow() was deprecated.
This is only available in python 3.11+. Use datetime.timezone.utc
instead which is available from python 3.2+

Fixes: freeipa#302

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
rcritten added a commit that referenced this issue Oct 16, 2023
We switched to datetime.UTC because datetime.utcnow() was deprecated.
This is only available in python 3.11+. Use datetime.timezone.utc
instead which is available from python 3.2+

Fixes: #302

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
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 a pull request may close this issue.

1 participant