Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

tarfile deprecation warning for PEP-706 should set a stacklevel #117691

Closed
Labels
3.12only security fixes3.13bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error
@AlexWaygood

Description

@AlexWaygood

Bug report

Bug description:

I just saw the following deprecation warning in the GitHub Actions log for a project I contribute to:

/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/tarfile.py:2221: 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.    warnings.warn(

Unfortunately, the warning doesn't tell me anything about which line in the project is triggering the warning. The warning points to the line intarfile.py inside the function that has the deprecation warning, rather than the line in my project that's calling thetarfile function in the depreacted way. We should set a stacklevel here to rectify this (I think stacklevel should be set to3?):

cpython/Lib/tarfile.py

Lines 2245 to 2250 ind5f1139

importwarnings
warnings.warn(
'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.',
DeprecationWarning)

Cc.@encukou as the author and implementer ofPEP-706

CPython versions tested on:

3.12

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12only security fixes3.13bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp