summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2018-12-06 09:43:56 -0800
committerGitHub <noreply@github.com>2018-12-06 09:43:56 -0800
commit8ffa2273ce739fe2b38b09f7f8aa37fde1591a18 (patch)
treefd15b443fa0a382fade15f8319ddab4bf2c976f6
parent8a115731966db1d723d03b4b599a5f3587edc94b (diff)
parent5d3ff239a75bdfd59b2c4adbfd2af343b3a36007 (diff)
downloadnumpy-8ffa2273ce739fe2b38b09f7f8aa37fde1591a18.tar.gz
Merge pull request #12493 from cgohlke/patch-2
BUG: fix records.fromfile fails to read data >4 GB
-rw-r--r--numpy/core/records.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/numpy/core/records.py b/numpy/core/records.py
index 9e09e46b3..86a43306a 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[shape.index(-1)] = size // -shapesize
shape = tuple(shape)
- shapeprod = sb.array(shape).prod()
+ shapeprod = sb.array(shape).prod(dtype=nt.intp)
nbytes = shapeprod * itemsize