[Numpy-discussion] Using loadtxt() twice on same file freezes python

David Cournapeau cournape at gmail.com
Thu Mar 26 12:58:47 EDT 2009


On Fri, Mar 27, 2009 at 1:14 AM, Sander de Kievit
<dekievit at strw.leidenuniv.nl> wrote:
> Hi,
>
> On my PC the following code freezes python:
>
> [code]
> import numpy as np
> from StringIO import StringIO
> c = StringIO("0 1\n2 3")
> np.loadtxt(c)
> np.loadtxt(c)
> [/code]
>
> Is this intentional behaviour or should I report this as a bug?

Which version of numpy are you using (numpy.version.version), on which OS ?

That's a most definitly not expected behavior (you should get an
exception the second time because the "stream" is empty - which is
exactly what happens on my installation, but your problem may be
platform specific).

cheers,

David



More information about the NumPy-Discussion mailing list