`TypeError: can't compare offset-naive and offset-aware datetimes` in a snapshot-age check.
BeginnerTroubleshootingRuntime, file, subprocess & encoding errors
Answer
Likely causes → boto3 returns timezone-aware datetimes (StartTime) and the code compares with naive datetime.now() or datetime.utcnow().
Diagnose →
print(snap["StartTime"].tzinfo, datetime.now().tzinfo)
Fix → from datetime import UTC, datetime; cutoff = datetime.now(UTC) - timedelta(days=90).
Prevent → Always use aware UTC datetimes; ruff rule DTZ005 flags naive now().
More on Runtime, file, subprocess & encoding errors
`KeyError: 'Tags'` while processing `describe_instances` output.Beginner`UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte` reading a log file.Intermediate`UnicodeEncodeError: 'ascii' codec can't encode character '✓'` when printing in a container.Intermediate`PermissionError: [Errno 13] Permission denied: '/var/log/app/report.json'`Intermediate`OSError: [Errno 24] Too many open files` in a long-running Python service.Intermediate`subprocess.CalledProcessError: Command '['terraform', 'plan']' returned non-zero exit status 1.` with no further detail.Beginner