GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fully implement PEP 706: Change default filter for TarFile.extract() and extractall() to 'data' · Issue #121999 · python/cpython

Fully implement PEP 706: Change default filter for TarFile.extract() and extractall() to 'data' #121999

New issue
Copy link
New issue
Copy link
Closed
Closed
Fully implement PEP 706: Change default filter for TarFile.extract() and extractall() to 'data'#121999
Copy link
Labels
type-featureA feature request or enhancementA feature request or enhancement

Description

@WilliamRoyNelson
WilliamRoyNelson
opened on Jul 19, 2024
Issue body actions

Feature or enhancement

Proposal:

The documentation for tarfile discusses changes to the default behavior in 3.14 as a future change, but now that 3.14 is in development this change should be implemented and references to the change should reflect that the default behavior is now implemented.

  • Change default behavior in tarfile.py
  • Remove deprecation warning when using None
  • Update tests to reflect new default behavior
  • Update tarfile documentation to reflect that the change has been implemented
  • Update shutil
  • Update shutil tests
  • Add test to ensure default filter is set to 'data'

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

https://peps.python.org/pep-0706/#defaults-and-their-configuration

If both the argument and attribute are None:

  • In Python 3.12-3.13, a DeprecationWarning will be emitted and extraction will use the 'fully_trusted' filter.
  • In Python 3.14+, it will use the 'data' filter.

https://docs.python.org/3.14/library/tarfile.html#extraction-filters

None (default): Use TarFile.extraction_filter.

If that is also None (the default), raise a DeprecationWarning, and fall back to the 'fully_trusted' filter, whose dangerous behavior matches previous versions of Python.

In Python 3.14, the 'data' filter will become the default instead. It’s possible to switch earlier; see TarFile.extraction_filter.

Linked PRs

  • gh-121999: Change default tarfile filter to 'data' #122002
Reacted by Petr Viktorin

Activity

  1. WilliamRoyNelson
    added
    type-featureA feature request or enhancementA feature request or enhancement
    on Jul 19, 2024
  2. WilliamRoyNelson
    added 3 commits that reference this issue on Jul 19, 2024

    pythongh-121999: Change default tarfile filter to 'data'

    29c1861

    pythongh-121999: Change default tarfile filter to 'data'

    0529960

    pythongh-121999: Change default tarfile filter to 'data'

    c74d0dc
  3. encukou
    added a commit that references this issue on Jul 26, 2024

    gh-121999: Change default tarfile filter to 'data' (GH-122002)

    dcafb36
  4. encukou
    closed this as completedon Jul 26, 2024
  5. encukou
    marked Update tarfile.extractall and friends to use filter='data' by default #118875 as a duplicate of this issue on May 8, 2025
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-featureA feature request or enhancementA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.