Skip to content

Deprecated use of datetime.datetime.utcnow() #131

@sean-maptek

Description

@sean-maptek

In Python 3.12, the function datetime.datetime.utcnow() was deprecated.

The replacement is using datetime.now() with datetime.timezone.utc. There is datetime.UTC which was introduced in 3.11 but to support older versions datetime.timezone.utc can be used.

I was made aware of this in omf 1.0.1, as I have deprecated warnings turned on to try to get a head start on fixing up issues in my code for future versions of Python. The problem is bad for 1.0.1 because the usage is in omf.base.UidModel which makes it widespread and hard to disable.

Looking at the current state in dev branch (7b349ec at the time of writing) for the 2.0.0 dev work, the situation is not as bad as it only effects the omf.fileio.save().

Is there any interest in a pull request for 1.0.1 with this change for a potential 1.0.2 release? Specially, given the current delays in omf 2.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions