Aur Saraf <sonofli...@gmail.com> added the comment:

Forgot an important warning: this is the first time I write C code against the 
Python API, and I didn't thoroughly read the guide (or at all, to be honest). I 
think I did a good job, but please suspect my code of noob errors.

I'm especially not confident that it's OK to not do any special handling of 
signals. Can read() return 0 if it was interrupted by a signal? This will stop 
the hash calculation midway and behave as if it succeeded. Sounds suspiciously 
like something we don't want. Also, I probably should support signals because 
such a long operation is something the user definitely might want to interrupt?

May I have some guidance please? Would it be enough to copy the code from 
fileutils.c _Py_Read() and addi an outer loop so we can do many reads with the 
GIL released and still call PyErr_CheckSignals when needed with the GIL taken?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue45150>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to