-
-
Notifications
You must be signed in to change notification settings - Fork 12k
Closed
Labels
Description
...Which, in fairness, is an edge case I should have guarded against myself. On the other hand, perhaps we could do some checking and toss a descriptive ValueError instead? I'm willing to write up a PR if that's an acceptable change.
Reproducing code example:
The following works with any shape, so long as any one of the axes is length 0:
import numpy as np
mmap = np.memmap('test.npy', shape=(0,4), mode='w+')Error message:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.5/dist-packages/numpy/core/memmap.py", line 250, in __new__
fid.seek(bytes - 1, 0)
OSError: [Errno 22] Invalid argument
Numpy/Python version information:
1.15.2 / 3.5.2