summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorcgohlke <cgohlke@uci.edu>2018-12-05 16:28:16 -0800
committerGitHub <noreply@github.com>2018-12-05 16:28:16 -0800
commit612cd65633eefea009b9f1aae6605b73523259d2 (patch)
tree69776a56066844f63f7fb2ae71f92e0aa9f6f7da /numpy
parent8a115731966db1d723d03b4b599a5f3587edc94b (diff)
downloadnumpy-612cd65633eefea009b9f1aae6605b73523259d2.tar.gz
BUG: fix records.fromfile fails to read data >4 GB
Use 64-bit integer accumulator for calculating the product of array shapes on 64-bit systems. Fixes #12442.
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/records.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/core/records.py b/numpy/core/records.py
index 9e09e46b3..db4a0fbd8 100644
--- a/numpy/core/records.py
+++ b/numpy/core/records.py
@@ -783,13 +783,13 @@ def fromfile(fd, dtype=None, shape=None, offset=0, formats=None,
itemsize = descr.itemsize
- shapeprod = sb.array(shape).prod()
+ shapeprod = sb.array(shape).prod(dtype=nt.intp)
shapesize = shapeprod * itemsize
if shapesize < 0:
shape = list(shape)
shape[shape.index(-1)] = size / -shapesize
shape = tuple(shape)
- shapeprod = sb.array(shape).prod()
+ shapeprod = sb.array(shape).prod(dtype=nt.intp)
nbytes = shapeprod * itemsize