Martin v. Löwis <mar...@v.loewis.de> added the comment: I think the error is really in _hashlib, not in the array object. It should not require 3.x style buffers, but continue to support 2.x readbuffers. Attached is a patch that takes this route to fixing the bug.
As for the checks for bf_releasebuffer: I still think they are necessary. If an object implements bf_releasebuffer, that means that the object may change the buffer underneath, unless proper locking and unlocking takes place. Indeed, the array's getreadbuf operation is not thread-safe. It might be possible to remove them if it is clarified that anybody calling getreadbuffer must not release the GIL while they hold on to the buffer. ---------- Added file: http://bugs.python.org/file15382/hashlib.diff _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue6071> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com