Skip to content

datetime.datetime.utcnow() is deprecated from python 3.12 #150

Open
@yobuntu

Description

@yobuntu

When using python 3.12 we trigger this warning

sqlalchemy_file/file.py:124: 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["uploaded_at"] = datetime.utcnow().isoformat()

This seems not to be a big deal, and easy to fix as the replacement code is provided in the warning itself.

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