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
{{ message }}
Repository navigation
empty_like not passing across attributes of memmap objects (Trac #1753) #2348
then b is also a memmap object. However, even though the type of b is 'memmap', it has no _mmap attribute (as you'd expect, since empty_like cannot know what file object to use).
The broken memmap object b causes failures elsewhere in array_finalise as it tries to copy attributes from b (filename, offset, mode) which do not exist.
In summary there are TWO bugs here:
empty_like (and friends) should not return objects of type memmap
the memmap.array_finalise method is checking for the existence of the _mmap attribute. In non-memmap objects, this may exist but be set to None, therefore this method needs to check that both _mmap exists as an attribute and is not None.
Activity
numpy-gitbot commentedon Oct 19, 2012
@mwiebe wrote on 2011-03-15
I just added a 'subok' parameter to empty_like. This allows
to create a regular array, not a memmap. While this doesn't fix the issue, it should help mitigate it in some circumstances.