Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ndarray.tofile raises ValueError on IO failure; would IOError be more appropriate? (Trac #1716) #2312

Closed
numpy-gitbot opened this issue Oct 19, 2012 · 0 comments

Comments

@numpy-gitbot
Copy link

Original ticket http://projects.scipy.org/numpy/ticket/1716 on 2011-01-17 by trac user mark.dickinson, assigned to unknown.

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants