Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue6071] no longer possible to hash arrays

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Nov 23, 2009, 12:37 AM

Post #1 of 2 (192 views)
Permalink
[issue6071] no longer possible to hash arrays

Martin v. Löwis <martin [at] v> 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 <report [at] bugs>
<http://bugs.python.org/issue6071>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 23, 2009, 11:51 AM

Post #2 of 2 (164 views)
Permalink
[issue6071] no longer possible to hash arrays [In reply to]

Antoine Pitrou <pitrou [at] free> added the comment:

> 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.

I know, but the problem is that by switching some argument definitions
to "s*" and friends we have broken compatibility for the (admittedly
uncommon) use case of giving an array object to those functions. Since
we probably don't want to backout those changes perhaps adding support
for the new buffer API to the array object is the best course of action.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6071>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.