summaryrefslogtreecommitdiff
path: root/numpy/lib/npyio.py
diff options
context:
space:
mode:
authorYaroslav Halchenko <debian@onerussian.com>2016-01-27 22:12:51 -0500
committerYaroslav Halchenko <debian@onerussian.com>2016-01-27 22:12:51 -0500
commit8a22dd42c2644c05500e2cea6974a6988a9dd01d (patch)
tree03d9e616f3de5afe9d2f29644b4bfe4c75732acf /numpy/lib/npyio.py
parent33777c64fefbd0919d3cf8f832c302205b4ede23 (diff)
downloadnumpy-8a22dd42c2644c05500e2cea6974a6988a9dd01d.tar.gz
ENH: catch and rethrow exception in _savez upon IOError with filename info
Diffstat (limited to 'numpy/lib/npyio.py')
-rw-r--r--numpy/lib/npyio.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/numpy/lib/npyio.py b/numpy/lib/npyio.py
index dd15db4b8..a80053750 100644
--- a/numpy/lib/npyio.py
+++ b/numpy/lib/npyio.py
@@ -644,6 +644,8 @@ def _savez(file, args, kwds, compress, allow_pickle=True, pickle_kwargs=None):
fid.close()
fid = None
zipf.write(tmpfile, arcname=fname)
+ except IOError as exc:
+ raise IOError("Failed to write to %s: %s" % (tmpfile, exc))
finally:
if fid:
fid.close()