Skip to content

Navigation Menu

Sign up

Metadata API: Accept zero-offset expiration datetimes - #3064

Open
FayezBast wants to merge 1 commit into
theupdateframework:develop from
FayezBast:fix/utc-zoneinfo-expiration
Open

FayezBast wants to merge 1 commit into
theupdateframework:develop from
FayezBast:fix/utc-zoneinfo-expiration

Conversation

@FayezBast

@FayezBast FayezBast commented Nov 26, 2026

Copy link
Copy Markdown

Signed.expires compares the timezone object to datetime.UTC, so it rejects ZoneInfo("UTC") even though the datetime has a zero UTC offset.

This PR checks the offset at the supplied datetime and stores accepted values as datetime.UTC at whole-second precision. Tests cover construction and assignment with ZoneInfo("UTC"), serialization with the Z suffix, and preservation of the previous expiration when a nonzero offset is rejected.

Testing

All 210 unit tests passed. Ruff, mypy, and Sphinx also passed.

Related to #3055, which made the setter validate before storing the new value.

Signed-off-by: FayezBast <fayezbast15@gmail.com>
FayezBast requested a review from a team as a code owner November 26, 2026 00:21

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /