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

David Cournapeau cournape@gmail....
Thu Mar 26 11:58:47 CDT 2009


On Fri, Mar 27, 2009 at 1:14 AM, Sander de Kievit
<dekievit@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