diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2019-04-11 21:00:27 -0700 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2019-04-11 21:00:27 -0700 |
commit | b60f33dd0747574570764ac8072386dccc85dd44 (patch) | |
tree | 9fcb07d5d08c770c38c08593ca51629c61d6210e /numpy/core/numeric.py | |
parent | d7a73f8c700edcf150d59a570e0173b60f84c7a7 (diff) | |
download | numpy-b60f33dd0747574570764ac8072386dccc85dd44.tar.gz |
BUG: Fix bad error message in np.memmap
This previously raisd `OSError: [Errno 22] Invalid argument` while trying to seek to byte -1 of the file.
It now raises `ValueError: cannot mmap an empty file`
The simple fix is not to write the file at all if we know it's already long enough.
In future we could consider allowing memmap to do an extra write behind the scenes to ensure the fiel is not empty, but that seems out of scope.
Fixes gh-12653
Diffstat (limited to 'numpy/core/numeric.py')
0 files changed, 0 insertions, 0 deletions