Skip to content

fix: replace deprecated utcfromtimestamp with fromtimestamp - #656

Draft
owenpearson wants to merge 1 commit into
mainfrom
update-utcfromtimestamp
Draft

owenpearson wants to merge 1 commit into
mainfrom
update-utcfromtimestamp

Conversation

@owenpearson

Copy link
Copy Markdown
Member

datetime.utcfromtimestamp is deprecated in Python 3.12

@coderabbitai

coderabbitai Bot commented Dec 16, 2025 •

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch update-utcfromtimestamp

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

datetime.utcfromtimestamp is deprecated in Python 3.12 and scheduled for
removal. Subtracting a naive datetime(1970, 1, 1) drops the deprecated call
while keeping _ms_since_epoch and _dt_from_ms_epoch on the naive UTC
datetimes they already accept and return.

fromtimestamp(0, timezone.utc) is not a drop-in substitute here: it makes the
epoch timezone-aware, so _ms_since_epoch raises TypeError for the naive start
or end a caller may pass to presence.history, and PresenceMessage.timestamp
changes from naive to aware. Aligning presence timestamps on aware datetimes
is worth doing, but it is an API change rather than a deprecation fix.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
staging/pull/656/features — 6e259644 Deployed Sep 29, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant