Skip to content

DeprecationWarning from tarfile.Tarfile.extractall in Python 3.12+ #379

@nernst

Description

@nernst

Hi,

I'm getting a DeprecationWarning from nodenv via pyright on Python 3.12:

.venv/lib/python3.12/site-packages/nodeenv.py:639: 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.
  archive.extractall(src_dir, extract_list)

This appears because Python 3.12 added a filter=None default argument to tarfile.TarFile.extractall in 3.12 and raises a DeprecationWarning when filter is None.

I think this can be resolved by adding filter="data" to the call when sys.version_info >= (3, 12).

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