[Numpy-discussion] numarray: Python crash

Edward C. Jones edcjones at comcast.net
Tue Jan 3 14:40:06 CST 2006


#! /usr/bin/env python

import numarray

"""I have an AMD64 PC with Debian unstable for i386 on it. I use Python
2.4.2 and numarray 1.5.0. I compile these myself.
"""

arr = numarray.array([-2000000000L], 'UInt32')
arr = numarray.array([-2000000000L], 'UInt32')

"""If I execute one of the two statements I get:

Exception exceptions.OverflowError: "can't convert negative value to 
unsigned long" in 'garbage collection' ignored
Fatal Python error: unexpected exception during garbage collection
Aborted

If I execute both statements, I get:

Traceback (most recent call last):
  File "./bug2.py", line 10, in ?
    arr = numarray.array([-2000000000L], 'UInt32')
  File 
"/usr/local/lib/python2.4/site-packages/numarray/numarraycore.py", line 
354, in array
    type=_typeFromTypeAndTypecode(type,typecode,dtype)
  File 
"/usr/local/lib/python2.4/site-packages/numarray/numarraycore.py", line 
278, in _typeFromTypeAndTypecode
    for a in [type, typecode, dtype]:
OverflowError: can't convert negative value to unsigned long
"""





More information about the Numpy-discussion mailing list