SystemError in `ImagePath.Path` item assignment and `ImageDraw` coordinates
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 66/100
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
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di python-pillow/Pillow
-
Warn that pre-applying arabic_reshaper + python-bidi corrupts text on a Raqm buildForse già presa @Syamjith-NK l’ha presa 55 giorni fa. ApertaDocumentation Font Rendering PNG Third Party Framework
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
python-pillow/Pillow#9907 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Image.putpixel incorrectly labels supported arguments in type annotationsForse già presa @radarhere l’ha presa 183 giorni fa. ApertaPNG
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
python-pillow/Pillow#9584 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Release Pillow 13.1.0 on January 2, 2027Forse già presa @radarhere l’ha presa 1 giorno fa. ApertaRelease
python-pillow/Pillow#10276 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Future of JPEG2000 supportApertaJPEG
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
python-pillow/Pillow#10241 · 4 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
`frombytes()` and in-place `ImageCms` transforms write into read-only image memoryForse già presa @tongwentao l’ha presa 3 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 50/100
python-pillow/Pillow#10235 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di python-pillow/Pillow
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
aws-samples/sample-per-model-bedrock#464 ·
I maintainer di solito rispondono entro 1 giorno
-
lesson-submission pending-review
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
Ikalus1988/MisakaNet#3789 ·
I maintainer di solito rispondono entro 1 giorno
-
Python Volcengine provider returns failures instead of raising themForse già presa @Ricardo-M-L l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
agent-infra/sandbox#248 ·
-
[Bug] cloud JSON directory loading assumes a Key field in fsspec listingsForse già presa @Ricardo-M-L l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
hiyouga/LlamaFactory#10910 ·
I maintainer di solito rispondono entro 1 giorno
-
Bundled uv is never updated and trusts the compromised eMudhra certificatesForse già presa @FabienDanieau l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100