[NumPy-Tickets] [NumPy] #1716: ndarray.tofile raises ValueError on IO failure; would IOError be more appropriate?

NumPy Trac numpy-tickets@scipy....
Mon Jan 17 08:46:05 CST 2011


#1716: ndarray.tofile raises ValueError on IO failure;  would IOError be more
appropriate?
----------------------------+-----------------------------------------------
 Reporter:  mark.dickinson  |       Owner:  somebody
     Type:  defect          |      Status:  new     
 Priority:  normal          |   Milestone:  2.0.0   
Component:  Other           |     Version:  1.5.0   
 Keywords:                  |  
----------------------------+-----------------------------------------------
 The following exception traceback was reported to me by the user of a
 numpy-based application:


 {{{
 File "C:\EPD622\lib\site-packages\numpy\lib\io.py", line 345, in save
 format.write_array(fid, arr)
 File "C:\EPD622\lib\site-packages\numpy\lib\format.py", line 401, in
 write_array
 array.tofile(fp)
 ValueError: 135453 requested and 6 written

 }}}

 While the cause of the error was never explicitly determined, it seems
 likely to have been as a result of an overfull disk.  The type and message
 of the exception are a little confusing here;  would it make sense for the
 exception type to be something like IOError rather than ValueError?

 This was with the version of numpy that ships with EPD 6.2.2, but I
 believe that the issue is still present in the current numpy source.  The
 error message appears to be coming from
 /numpy/core/src/multiarray/convert.c, as a result of a system-level fwrite
 call failing to write all the expected items (i.e., encountering a system-
 level IO error).

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/1716>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list