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

Use email.utils.parsedate_to_datetime to parse RFC (2)822 dates #46042

Merged
merged 1 commit into from
May 8, 2024

Conversation

gsnedders
Copy link
Member

After c3a572d, checking the key cert via OpenSSL failed with a mismatch between aware and naive datetime objects. This happened because strptime creates a naive datetime object even when "%Z" is in the format string.

Instead, use the RFC 2822 date parser in email.utils, as this is the output format of OpenSSL, which produces an aware datetime object.

Fixes #46040.

After c3a572d, checking the key cert via OpenSSL failed with a mismatch
between aware and naive datetime objects. This happened because strptime
creates a naive datetime object even when "%Z" is in the format string.

Instead, use the RFC 2822 date parser in email.utils, as this is the
output format of OpenSSL, which produces an aware datetime object.
@gsnedders gsnedders closed this May 7, 2024
@gsnedders gsnedders reopened this May 7, 2024
@jgraham jgraham merged commit d2dbbf8 into web-platform-tests:master May 8, 2024
36 checks passed
@gsnedders gsnedders deleted the rfc822-date-parse branch May 8, 2024 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

REGRESSION(c3a572d): TypeError: can't compare offset-naive and offset-aware datetimes
5 participants