<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Sep 14, 2013 at 12:12 AM, Christoph Gohlke <span dir="ltr"><<a href="mailto:cgohlke@uci.edu" target="_blank">cgohlke@uci.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 9/13/2013 7:10 PM, Charles R Harris wrote:<br>
> Hi Christolph,<br>
><br>
> Could you debug this a bit?<br>
><br>
> ERROR: test_record_no_hash (test_multiarray.TestRecord)<br>
> ----------------------------------------------------------------------<br>
> Traceback (most recent call last):<br>
> File<br>
> "X:\Python33\lib\site-<br>
> packages\numpy\core\tests\test_multiarray.py",<br>
> line 2464, in test_record_no_hash<br>
> self.assertRaises(TypeError, hash, a[0])<br>
> File "X:\Python33\lib\unittest\case.py", line 570, in assertRaises<br>
> return context.handle('assertRaises', callableObj, args, kwargs)<br>
> File "X:\Python33\lib\unittest\case.py", line 135, in handle<br>
> callable_obj(*args, **kwargs)<br>
> File "X:\Python33\lib\unittest\case.py", line 153, in __exit__<br>
> self.obj_name))<br>
> TypeError: unhashable type: 'writeable void-scalar'<br>
><br>
><br>
> I don't understand that at all.<br>
><br>
> <snip><br>
><br>
> Chuck<br>
><br>
<br>
</div></div>I could reproduce the weirdness outside the testsuite on 64 bit Python<br>
3.2, 3.3 and 3.4. It looks like the interpreter gets corrupted.<br>
<br>
It could be due to numpy 1.8 using a wrong signature for the hash<br>
function [1] on win-amd64-py3.x. Since Python 3.2 the return value must<br>
be of type `Py_hash_t` (defined as `Py_ssize_t`) [2], not `C long` as<br>
for Python <= 3.1.<br>
<br>
[1]<br>
<a href="https://github.com/numpy/numpy/blob/master/numpy/core/src/multiarray/scalartypes.c.src#L3038" target="_blank">https://github.com/numpy/numpy/blob/master/numpy/core/src/multiarray/scalartypes.c.src#L3038</a><br>
[2] <a href="http://docs.python.org/3.2/c-api/typeobj.html#PyTypeObject.tp_hash" target="_blank">http://docs.python.org/3.2/c-api/typeobj.html#PyTypeObject.tp_hash</a><br>
<div class="HOEnZb"><div class="h5"><br></div></div></blockquote><div><br></div><div>That would do it. I'll bet you are right.<br><br></div><div>Chuck <br></div></div></div></div>