python / python/cpython

Tarfile regression

Abierto
#144,755 7 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

pending stdlib type-bug
Lenguaje dominante
Python
Estrellas
77.2k
Forks
35.9k
Métricas de merge de PR
Métricas de PR pendientes

Descripción

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

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza en tarfile.py, en _get_filtered_attrs, y luego reproduce el fallo de data_filter informado en las versiones compatibles de Python anteriores a 3.14. Verifica que las operaciones de tarfile ya no generen AttributeError para os.path.ALLOW_MISSING y confirma que el escenario de instalación informado está resuelto.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python
Área
backend
Tipo de issue
Error
Dificultad
2/5
Tiempo estimado
1-3 horas
Estado de actividad
Estancado
Claridad
Bien especificado
Aptitud para principiantes
52/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.