You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
I couldn't find anything in the docs about how to use the
progress
callback function available inSaneDev.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 withinsane.py
would be to check the type of the progress object passed in tosnap()
, and wrap it in a function that accepts two arguments.The text was updated successfully, but these errors were encountered: