Message415324
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? |
|
Date |
User |
Action |
Args |
2022-03-16 02:36:04 | Aur.Saraf | set | recipients:
+ Aur.Saraf, gregory.p.smith, christian.heimes, tarek, python-dev |
2022-03-16 02:36:04 | Aur.Saraf | set | messageid: <1647398164.57.0.670119740472.issue45150@roundup.psfhosted.org> |
2022-03-16 02:36:04 | Aur.Saraf | link | issue45150 messages |
2022-03-16 02:36:04 | Aur.Saraf | create | |
|