[Numpy-discussion] Crash with nested recarray on Python 3.x

Christoph Gohlke cgohlke@uci....
Thu Mar 10 12:55:44 CST 2011



On 3/9/2011 10:29 PM, Charles R Harris wrote:
>
>
> On Wed, Mar 9, 2011 at 11:20 PM, Christoph Gohlke <cgohlke@uci.edu
> <mailto:cgohlke@uci.edu>> wrote:
>
>     Hello,
>
>     the following code crashes in the last line when using numpy 1.5.1 on
>     Python 3.1 and 3.2, 32 and 64 bit, for Windows. It works with Python
>     2.x. Can anyone confirm the crash on other platforms?
>
>     import numpy
>     RECORD1 = [('i', 'i4')]
>     RECORD2 = [('j', RECORD1, 2)]
>     a = numpy.recarray((1,), RECORD2)
>     a.data
>
>
> Don't see it here.
>
> Python 3.1.2 (r312:79147, Sep  8 2010, 23:02:57)
> [GCC 4.5.1 20100812 (Red Hat 4.5.1-1)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>> >> import numpy
>> >> RECORD1 = [('i', 'i4')]
>> >> RECORD2 = [('j', RECORD1, 2)]
>> >> a = numpy.recarray((1,), RECORD2)
>> >> a.data
> <memory at 0x1fbf478>
>> >> numpy.__version__
> '1.6.0.dev-3f0f12f'
>
> OTOH, the values look suspicious
>
>> >> a
> rec.array([(array([(-1770425816,), (62,)],
>        dtype=[('i', '<i4')]),)],
>        dtype=[('j', [('i', '<i4')], (2,))])
>
> Hmm...
>
> Chuck
>

This is apparently fixed in numpy 1.6.0.dev.

I opened a ticket for numpy 1.5.x at 
<http://projects.scipy.org/numpy/ticket/1766>.

Christoph



More information about the NumPy-Discussion mailing list