Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

SystemError in `ImagePath.Path` item assignment and `ImageDraw` coordinates

Abierto
#10,284 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@shivanshjain456 ya está trabajando en esto.

Desde el 22/10/2026.

  • #10287 de @shivanshjain456 — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
66/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
c, python
Área
backend

Línea de trabajo

Start by reading src/path.c, focusing on item assignment and assign_item_to_array(). Reproduce the list assignment case and the invalid coordinate conversion case with the examples in the issue, then check nearby tests for ImagePath.Path assignment and ImageDraw coordinates. Done means both cases raise normal Python exceptions instead of SystemError, with tests covering the regressions.

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

Descripción

Environment

  • Pillow 13.0.0, the official wheel from PyPI
  • Python 3.12.15
  • Debian GNU/Linux 13 (trixie), x86_64

Summary

Two places in src/path.c let invalid input escape as SystemError, which implies an internal error, instead of a normal Python exception. First, item assignment on an ImagePath.Path passes the assigned value to PyArg_ParseTuple(), which only accepts tuples. So path[0] = [1, 2] raises SystemError, although the constructor accepts list pairs. Second, when coordinates are flattened, assign_item_to_array() converts ints with PyLong_AS_LONG() and other numbers with PyFloat_AsDouble(), without checking for errors.

Reproducers

from PIL import ImagePath

p = ImagePath.Path([(0, 0), (1, 1)])
p[0] = (1, 2)
p[0] = [1, 2]  # SystemError
Traceback (most recent call last):
  File "repro1.py", line 5, in <module>
    p[0] = [1, 2]  # SystemError
    ~^^^

SystemError: new style getargs format but argument is not a tuple

or

from decimal import Decimal

from PIL import Image, ImageDraw, ImagePath

class Coord:
    def __float__(self):
        raise ValueError("bad coordinate")


draw = ImageDraw.Draw(Image.new("RGB", (4, 4)))

draw.line([Decimal("sNaN"), 0, 1, 1])
Lenguaje dominante
Python
Estrellas
13.9k
Forks
2.5k
Merge medio
1 d 8 min
PR fusionados (30 d)
149

Preparar el entorno

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.

Más de python-pillow/Pillow

Todos los issues de python-pillow/Pillow

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.