Skip to content

Fix is_expired docstring for reference_time - #3009

Merged
jku merged 1 commit into
theupdateframework:developfrom
Sachith77:fix/is-expired-docstring
Sep 1, 2026
Merged

Fix is_expired docstring for reference_time#3009
jku merged 1 commit into
theupdateframework:developfrom
Sachith77:fix/is-expired-docstring

Conversation

@Sachith77

Copy link
Copy Markdown
Contributor

The Signed.is_expired() docstring says that reference_time should be a naive datetime, but passing a naive datetime raises:

snapshot.is_expired(datetime(2026, 1, 1))
TypeError: can't compare offset-naive and offset-aware datetimes

self.expires is timezone-aware, and the default datetime.now(timezone.utc) is aware as well, so reference_time needs to be timezone-aware too.

This PR only updates the docstring and does not change the behaviour.

Signed-off-by: Sachith Reddy <sachith.24bcs10403@sst.scaler.com>
@Sachith77
Sachith77 requested a review from a team as a code owner September 1, 2026 07:19

@jku jku left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks correct, thanks

@jku
jku merged commit 7573dc7 into theupdateframework:develop Sep 1, 2026
17 checks passed
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