Segfault if `progress` function passed into `SaneDev.snap()` has one argument
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start in sane.py and _sane.c, then reproduce SaneDev.snap() with a progress callback accepting one argument and compare it with the documented two-argument form. Trace how the callback is invoked and ensure the one-argument case no longer segfaults; update the documentation if the callback requirements remain unclear.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I couldn't find anything in the docs about how to use the progress callback function available in SaneDev.snap(). My first try was to pass in a function with only one argument, and this caused a segmentation fault in the python interpreter. (For anyone looking, you need to pass in a function that accepts two arguments. The first will be the number of lines scanned so far, and the second will be the total number of lines).
I'm not super familiar with CPython but it looks like passing two arguments into a python callable that only accepts one causes a segfault. I couldn't find a way in the docs to check the number of arguments in CPython (that must exist right?) so I don't know how to fix it in _sane.c. However one simple fix within sane.py would be to check the type of the progress object passed in to snap(), and wrap it in a function that accepts two arguments.
- Lingua principale
- C
- Stelle
- 61
- Fork
- 22
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
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/Sane
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
python-pillow/Sane#110 · 1 commento · 1 reazione ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 50/100
python-pillow/Sane#107 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
python-pillow/Sane#103 ·
-
Sane leaks filedescriptors Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
python-pillow/Sane#93 ·
-
Cannot push virtual buttons Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
python-pillow/Sane#92 ·
Tutte le issue di python-pillow/Sane
Issue simili
-
level/task module/gcp type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
hapostgres/pg_auto_failover#1190 ·
-
docs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
-
P3 sonic-vpp
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
sonic-net/sonic-buildimage#29662 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 94/100
spack/spack-packages#6586 ·