summaryrefslogtreecommitdiff
path: root/numpy/lib/format.py
diff options
context:
space:
mode:
authorJulian Taylor <juliantaylor108@googlemail.com>2013-11-09 02:20:40 -0800
committerJulian Taylor <juliantaylor108@googlemail.com>2013-11-09 02:20:40 -0800
commit896863aff98a156b2fe0fca85fa9279ae8f15aec (patch)
tree5e35be446a50083831d76d55dfa370f41713ec0d /numpy/lib/format.py
parentff3c89fd0b0c311db316d3d574382336ad3017f7 (diff)
parent83eb3ac0658d5e71d9860f8b1e37f285ec19c692 (diff)
downloadnumpy-896863aff98a156b2fe0fca85fa9279ae8f15aec.tar.gz
Merge pull request #4027 from halfaleague/chunk-read-bug
Chunked reading fails when dtype.itemsize is larger than buffer size.
Diffstat (limited to 'numpy/lib/format.py')
-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)