Skip to content

fix: update datetime timezone reference to maintain compatibility wit… - #9

Merged
gitricko merged 2 commits into
mainfrom
fix
May 20, 2026
Merged

gitricko merged 2 commits into
mainfrom
fix

Conversation

@gitricko

Copy link
Copy Markdown
Owner

This pull request makes a minor update to the way UTC timestamps are generated in mnemon/__init__.py. The change replaces the use of datetime.UTC with the correct timezone.utc for creating timezone-aware timestamps. This ensures compatibility with the standard library and avoids potential errors.

  • Updated timestamp creation to use timezone.utc instead of the incorrect datetime.UTC in mnemon/__init__.py. [1] [2]…h older Python versions

Copilot AI review requested due to automatic review settings May 20, 2026 18:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates UTC timestamp generation in MnemonMemoryProvider to use timezone.utc instead of datetime.UTC, keeping stored index timestamps timezone-aware while improving compatibility with Python environments that may not expose datetime.UTC.

Changes:

  • Import timezone from datetime.
  • Replace datetime.now(datetime.UTC) with datetime.now(timezone.utc) when writing "ts" in the local ID index.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread mnemon/__init__.py Outdated
Comment on lines +23 to +24
from datetime import datetime
from datetime import timezone
@gitricko
gitricko merged commit b4d97bd into main May 20, 2026
7 checks passed
@gitricko
gitricko deleted the fix branch May 20, 2026 19:16
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.

3 participants