Skip to content

Commit 11a07a1

Browse files
Copilotstsewd
andauthored
Use timezone-aware datetime for SSH key cutoff date comparison (#12538)
Addresses feedback from #12536 to use timezone-aware datetime objects in the SSH key write access deprecation check. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: stsewd <4975310+stsewd@users.noreply.github.com>
1 parent 1744da8 commit 11a07a1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

readthedocs/doc_builder/director.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,8 @@ def checkout(self):
218218
{"has_ssh_key_with_write_access": has_ssh_key_with_write_access}
219219
)
220220

221-
hard_failure = datetime.datetime.now() >= datetime.datetime(2025, 12, 1)
221+
now = datetime.datetime.now(tz=datetime.timezone.utc)
222+
hard_failure = now >= datetime.datetime(2025, 12, 1, 0, 0, 0, tzinfo=datetime.timezone.utc)
222223
if has_ssh_key_with_write_access:
223224
if hard_failure and settings.RTD_ENFORCE_BROWNOUTS_FOR_DEPRECATIONS:
224225
raise BuildUserError(BuildUserError.SSH_KEY_WITH_WRITE_ACCESS)

0 commit comments

Comments
 (0)