You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mne\io\base.py:2376: in _allocate_data
data = np.memmap(str(preload), mode="w+", dtype=dtype, shape=shape)
C:\hostedtoolcache\windows\Python\3.11.7\x64\Lib\site-packages\numpy\_core\memmap.py:233: in __new__
f_ctx = open(
E OSError: [Errno 22] Invalid argument: 'memmap.dat'
I restarted the job and got the same error. I find this a bit baffling and am not 100% sure this is a NumPy issue. I see #25409 touched memmap.py in the right time frame but I am not sure how __array_wrap__ could be a culprit here. Notably there is no failure on Linux pip-pre so somehow this is Windows-specific. EDIT: Also no failure on other Windows jobs so it seems likely to be NumPy 2.0.0.dev0-specific, too.
I will try to replicate locally on my Windows boot tomorrow but wanted to throw this out there in case anyone had ideas for immediate culprits. I thought maybe pytest could be an issue but their last stable 7.4.4 came out weeks ago and we've had green builds since then.
Looks like it has to do with reusing the same memmap files which is probably unsafe anyway. No idea why this happens only now but it seems like a bug at our end so I'll close, sorry for the noise!
I've also experienced this issue, but only while using mode='w+' on an existing memmap. It works fine with 'r+', but I think that, if nothing else, the documentation should reflect this. Currently, the row for w+ says:
‘w+’ | Create or overwrite existing file for reading and writing. If mode == 'w+' then shape must also be specified.
This tells the user they can use 'w+' on an existing memmap.
@carbonox-infernox can you check to see if that's the case for plain NumPy arrays (i.e., without using MNE-Python at all)? If so then it's probably worth opening an issue in NumPy rather than MNE-Python to update their docs
@larsoner it must be an issue with regular NumPy, because I've never heard of MNE-Python before this moment. I suppose this is worth opening a separate issue without referring to that.
Activity
ngoldbaum commentedon Jan 23, 2024
This needs a bit more info to be actionable on our end
larsoner commentedon Jan 24, 2024
Looks like it has to do with reusing the same memmap files which is probably unsafe anyway. No idea why this happens only now but it seems like a bug at our end so I'll close, sorry for the noise!
carbonox-infernox commentedon Feb 28, 2025
I've also experienced this issue, but only while using mode='w+' on an existing memmap. It works fine with 'r+', but I think that, if nothing else, the documentation should reflect this. Currently, the row for w+ says:
‘w+’ | Create or overwrite existing file for reading and writing. If mode == 'w+' then shape must also be specified.This tells the user they can use 'w+' on an existing memmap.
larsoner commentedon Mar 3, 2025
@carbonox-infernox can you check to see if that's the case for plain NumPy arrays (i.e., without using MNE-Python at all)? If so then it's probably worth opening an issue in NumPy rather than MNE-Python to update their docs
carbonox-infernox commentedon Mar 19, 2025
@larsoner it must be an issue with regular NumPy, because I've never heard of MNE-Python before this moment. I suppose this is worth opening a separate issue without referring to that.