Skip to content

Deprecation warning for tarfile extraction when running Python 3.12.9 #125

@matt-steen

Description

@matt-steen

Describe the bug
When running our tests using Python 3.12.9, we get the following deprecation warning:

tests/test_visitor_resource.py: 14 warnings
  /Users/msteen/code/platform/.venv/lib/python3.12/site-packages/pymongo_inmemory/downloader/__init__.py:84: 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.
    t.extract(f, extracted_folder)

To Reproduce

  1. Run tests in another project with the ignore_cache config option set to true:
    PYMONGOIM__IGNORE_CACHE=True uv run pytest
  2. See the deprecation warnings

Expected behavior
There shouldn't be any deprecation warnings.

Context:

  • OS: MacOS, CI runners
  • Version of pymongo_inmemory: 0.5.0
  • Version of mongo you are downloading: 8.0

Additional Notes
See the tarfile docs for more information on filters and the deprecation warning.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions