Skip to content

DeprecationWarning: datetime.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) #1530

@jasongi

Description

@jasongi

I saw this in the log output of Collectfasta tests

  /root/.venvs/collectfasta/lib/python3.12/site-packages/storages/backends/azure_storage.py:126: DeprecationWarning: datetime.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).
    self._user_delegation_key_expiry = datetime.utcnow()

Ideally all instances of utcnow should be replaced with datetime.now(datetime.UTC) as suggested.

Current references from this search:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions