Tarfile regression
還沒有人認領這個 Issue。
- 主要語言
- Python
- 星號
- 77.2k
- 分支
- 36k
- 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
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 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