Summary
readiness-check.py:1059 uses datetime.utcnow(), which is deprecated in Python 3.12 and scheduled for removal in a future version. Surfaces as a DeprecationWarning on every readiness-check cycle on hosts running Python 3.12+.
Repro
python -m pytest tests/test_state_files_and_events.py -q
# warnings.warn output:
# E:\GitHub\fula-ota\docker\fxsupport\linux\readiness-check.py:1059:
# DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled
# for removal in a future version. Use timezone-aware objects to represent
# datetimes in UTC: datetime.datetime.now(datetime.UTC).
Suggested fix
from datetime import datetime, timezone
# was:
timestamp = datetime.utcnow().isoformat(timespec=milliseconds) + Z
# replace with:
timestamp = datetime.now(timezone.utc).isoformat(timespec=milliseconds).replace(+00:00, Z)
Or, cheaper:
timestamp = datetime.now(timezone.utc).strftime(%Y-%m-%dT%H:%M:%S.%f)[:-3] + Z
Why it matters
- Today: cosmetic noise in test output.
- When the lab device''s Python is upgraded past whichever release actually removes utcnow(): TypeError at runtime in
post_heartbeat() → heartbeat fails silently → discovery thinks device is dead.
Scope
- File:
docker/fxsupport/linux/readiness-check.py:1059 (post_heartbeat) — and any other datetime.utcnow() callers in the same file (grep first).
- Small surgical fix; one PR.
Discovered during
Blox AI plan, surfaced in pytest warnings during Phase 13/14 cycles, 2026-05-24.
Summary
readiness-check.py:1059usesdatetime.utcnow(), which is deprecated in Python 3.12 and scheduled for removal in a future version. Surfaces as aDeprecationWarningon every readiness-check cycle on hosts running Python 3.12+.Repro
Suggested fix
Or, cheaper:
Why it matters
post_heartbeat()→ heartbeat fails silently → discovery thinks device is dead.Scope
docker/fxsupport/linux/readiness-check.py:1059(post_heartbeat) — and any otherdatetime.utcnow()callers in the same file (grep first).Discovered during
Blox AI plan, surfaced in pytest warnings during Phase 13/14 cycles, 2026-05-24.