This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Aur.Saraf
Recipients Aur.Saraf, christian.heimes, gregory.p.smith, python-dev, tarek
Date 2022-03-16.02:36:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1647398164.57.0.670119740472.issue45150@roundup.psfhosted.org>
In-reply-to
Content
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?
History
Date User Action Args
2022-03-16 02:36:04Aur.Sarafsetrecipients: + Aur.Saraf, gregory.p.smith, christian.heimes, tarek, python-dev
2022-03-16 02:36:04Aur.Sarafsetmessageid: <1647398164.57.0.670119740472.issue45150@roundup.psfhosted.org>
2022-03-16 02:36:04Aur.Saraflinkissue45150 messages
2022-03-16 02:36:04Aur.Sarafcreate