Skip to content

fix : replaced deprecated datetime.utcnow with timezone-aware alternative in adaptive_learning.py - #1354

Open
tmdeveloper007 wants to merge 1 commit into
komalharshita:mainfrom
tmdeveloper007:#1349
Open

fix : replaced deprecated datetime.utcnow with timezone-aware alternative in adaptive_learning.py#1354
tmdeveloper007 wants to merge 1 commit into
komalharshita:mainfrom
tmdeveloper007:#1349

Conversation

@tmdeveloper007

Copy link
Copy Markdown
Contributor

Summary of What Has Been Done

Replaced all occurrences of the deprecated datetime.utcnow() with datetime.now(timezone.utc) in src/utils/adaptive_learning.py. This addresses the Python 3.12+ deprecation warning for naive UTC datetime objects.

Changes Made

  • Changed from datetime import datetime to from datetime import datetime, timezone in the import statement
  • Replaced 5 occurrences of datetime.utcnow() with datetime.now(timezone.utc) across the following methods:
    • create_user_profile
    • assess_skill_level
    • record_progress
    • _adapt_path

Impact it Made

  • Code is now compatible with Python 3.12+ and future Python versions
  • Uses timezone-aware datetime objects which prevent subtle timezone-related bugs
  • Follows Python best practices as recommended by the official deprecation notice

Closes #1349

Note: please assign this PR to the tmdeveloper007 account.

@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix : replace deprecated datetime.utcnow with timezone-aware alternative in adaptive_learning.py

1 participant