summaryrefslogtreecommitdiff
path: root/numpy/lib
diff options
context:
space:
mode:
authorLuke Carmichael <luke@deepfield.net>2013-11-08 16:18:49 -0500
committerLuke Carmichael <luke@deepfield.net>2013-11-08 16:18:49 -0500
commit92b9e8446d342a35fbea2dd004a99f2815b14f69 (patch)
treebf28b69093138d9fd4e4850b9e767f8d21c30937 /numpy/lib
parentf30cecb89264660b5818fedaf7ce1fbb3e35050b (diff)
downloadnumpy-92b9e8446d342a35fbea2dd004a99f2815b14f69.tar.gz
When reading file in chunks, buffer_size < dtype.itemsize, ensure at least one read
Diffstat (limited to 'numpy/lib')
-rw-r--r--numpy/lib/format.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/lib/format.py b/numpy/lib/format.py
index fd5496e96..c411715d8 100644
--- a/numpy/lib/format.py
+++ b/numpy/lib/format.py
@@ -464,7 +464,7 @@ def read_array(fp):
# non-chunked case count < max_read_count, so only one read is
# performed.
- max_read_count = BUFFER_SIZE // dtype.itemsize
+ max_read_count = BUFFER_SIZE // min(BUFFER_SIZE, dtype.itemsize)
array = numpy.empty(count, dtype=dtype)