[SciPy-user] numpy.fastCopyAndTranspose Segfaults
Travis E. Oliphant
Wed Apr 30 10:10:04 CDT 2008
> I tried posting to the numpy mailing list but it didn't seem to make it through
> so I'm re-posting in case it's of interest to the scipy community.
> As the subject says the below code will crash the Python interpreter. I'm
> running 32-bit Win XP on an x64 xeon cpu.
> Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on
> Type "help", "copyright", "credits" or "license" for more information.
> from datetime import datetime, timedelta
> from numpy import asarray, fastCopyAndTranspose
> import numpy
> timestamps = [datetime(2007,1,1)]
> while timestamps[-1] < datetime(2007,12,31):
> timestamps.append(timestamps[-1] + timedelta(1))
> x = [asarray(timestamps),asarray(range(len(timestamps)))]
It looks like the segfault occurs in the printing of the result. If
you set y = fastCopyAndTranspose(x) you don't get a segfault until you
try to print it (actually __repr__ it).
This should be filed as a ticket.
More information about the SciPy-user