[Numpy-discussion] Inconsistent error messages.

Charles R Harris charlesr.harris at gmail.com
Fri May 22 23:19:26 EDT 2009


Hi All,

Currently fromfile prints a message raises a MemoryError when more items are
requested than read, but fromstring raises a value error:

In [8]: fromstring("", count=10)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)

/home/charris/<ipython console> in <module>()

ValueError: string is smaller than requested size

In [9]: fromfile("empty.dat", count=10)
10 items requested but only 0 read
---------------------------------------------------------------------------
MemoryError                               Traceback (most recent call last)

/home/charris/<ipython console> in <module>()

MemoryError:

I think fromfile should also raise a ValueError in this case. Thoughts?

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20090522/9a32d3b2/attachment.html>


More information about the NumPy-Discussion mailing list