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

Charles R Harris charlesr.harris@gmail....
Thu Mar 10 00:29:11 CST 2011


On Wed, Mar 9, 2011 at 11:20 PM, Christoph Gohlke <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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20110309/b6d092af/attachment.html 


More information about the NumPy-Discussion mailing list