-
Notifications
You must be signed in to change notification settings - Fork 3
Labels
claudeIssues created by ClaudeIssues created by Claude
Description
Issue Description
The test suite shows deprecation warnings for datetime.utcnow() which is scheduled for removal in a future Python version.
Deprecation Warning
DeprecationWarning: 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).
Affected Files
Based on test output, the following files use deprecated datetime.utcnow():
-
controllers/api/show/script/script.py:260
- Usage:
revision.edited_at = datetime.utcnow()
- Usage:
-
controllers/api/show/script/revisions.py:116
- Usage:
now_time = datetime.utcnow()
- Usage:
-
controllers/api/show/shows.py:87
- Usage:
now_time = datetime.utcnow()
- Usage:
Recommended Fix
Replace all instances of:
datetime.utcnow()With the timezone-aware alternative:
datetime.now(datetime.UTC)This requires:
- Import
datetimefrom the standard library (already imported in these files) - Update all
datetime.utcnow()calls todatetime.now(datetime.UTC) - Verify timezone handling is consistent across the application
Additional Investigation Needed
- Search entire codebase for all
datetime.utcnow()usages - Check if any database schema or ORM expects naive vs timezone-aware datetimes
- Verify tests still pass after migration
- Consider if any API responses need updating to maintain compatibility
Priority
Medium - Not breaking functionality currently, but should be addressed before Python deprecates the method entirely.
Metadata
Metadata
Assignees
Labels
claudeIssues created by ClaudeIssues created by Claude