Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#10,284 3 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@shivanshjain456 ci sta già lavorando.

Dal 22/10/2026.

  • #10287 di @shivanshjain456 — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
66/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
c, python
Ambito
backend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

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

draw.line([Decimal("sNaN"), 0, 1, 1])
Lingua principale
Python
Stelle
13.9k
Fork
2.5k
Merge medio
1g 6h
PR unite (30g)
159

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di python-pillow/Pillow

Tutte le issue di python-pillow/Pillow

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.