diff options
author | NoƩ Rubinstein <noe.rubinstein@gmail.com> | 2023-01-27 19:39:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-27 19:39:38 +0100 |
commit | 41499995a4c532556b2b6d6e3c0fabb0a7bdb61a (patch) | |
tree | 9776bca523d90e02388442a38740a04eb4d41731 /numpy/array_api/_indexing_functions.py | |
parent | 2289292db6a19f2bbfddd3dea3790ffa19955333 (diff) | |
download | numpy-41499995a4c532556b2b6d6e3c0fabb0a7bdb61a.tar.gz |
API: Raise EOFError when trying to load past the end of a `.npy` file (#23105)
Currently, the following code:
```
import numpy as np
with open('foo.npy', 'wb') as f:
for i in range(np.random.randint(10)):
np.save(f, 1)
with open('foo.npy', 'rb') as f:
while True:
np.load(f)
```
Will raise:
```
ValueError: Cannot load file containing pickled data when allow_pickle=False
```
While there is no pickled data in the file.
Diffstat (limited to 'numpy/array_api/_indexing_functions.py')
0 files changed, 0 insertions, 0 deletions