python / python/cpython

Tarfile regression

オープン
#144,755 コメント 7 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

pending stdlib type-bug
主要言語
Python
スター
77.2k
フォーク
35.9k
PR マージ指標
PR 指標を取得中

説明

Bug report

Bug description:

The function _get_filtered_attrs in tarfile.py references the special value os.path.ALLOW_MISSING. This is a problem because this value was only introduced in Python 3.14. However, the reference to this value has been backported to earlier supported Python versions. The result is that tarfile.py can throw an exception when being called from Python versions prior to 3.14.

  File "/usr/local/lib/python3.12/tarfile.py", line 845, in data_filter
    new_attrs = _get_filtered_attrs(member, dest_path, True)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/tarfile.py", line 770, in _get_filtered_attrs
    dest_path = os.path.realpath(dest_path, strict=os.path.ALLOW_MISSING)
                                                   ^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'posixpath' has no attribute 'ALLOW_MISSING'

In Python 3.12, the bug first appears in version 3.12.11.

In the Python 3.13 branch, the bug was introduced in 3.13.4, and persists in all subsequent versions.

In Python 3.11, it appears in all versions after and including 3.11.13

And in the Python 3.10 line, 3.10.18 is the first version where this value appears.

Personally, my symptom of this problem is that this bug prevents me from installing common libraries such as numpy because pip uses the tarfile library to unpack the download from PyPI.

CPython versions tested on:

3.12

Operating systems tested on:

Linux

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

tarfile.py の _get_filtered_attrs から開始し、サポート対象の 3.14 より前の Python バージョンで報告された data_filter の失敗を再現します。tarfile の操作で os.path.ALLOW_MISSING に対する AttributeError が発生しなくなったことを確認し、報告されたインストールシナリオに対応できていることを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
backend
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
52/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。