Skip to content

Fix DeprecationWarning in timeutils.py and archive.py #75

Description

@tdruez
commoncode/timeutils.py:61: 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).
  datim = dt or datetime.utcnow()
commoncode/archive.py:61: DeprecationWarning: Python 3.14 will, by default, filter extracted tar archives and reject files or modify their metadata. Use the filter argument to control this behavior.
  tar.extractall(target_dir, members=to_extract)

Activity

  1. Aryanrai23 commented on Jan 24, 2025

    @Aryanrai23
    commoncode/timeutils.py:61: 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).
      datim = dt or datetime.utcnow()
    
    commoncode/archive.py:61: DeprecationWarning: Python 3.14 will, by default, filter extracted tar archives and reject files or modify their metadata. Use the filter argument to control this behavior.
      tar.extractall(target_dir, members=to_extract)
    

    hey! I am intrested in fixing this.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions