-
-
Notifications
You must be signed in to change notification settings - Fork 12.2k
Closed
Labels
Description
Describe the issue:
Arrays returned by np.frombuffer() do not have the same base attribute when compared before and after version 1.22.4. I believe this behavior may only be reproduceable on Windows/OSX.
Related:
- BUG: Make mmap handling safer in frombuffer #21324
- BUG: distribute_jobs no longer works on Win/MacOS tomopy/tomopy#585
Reproduce the code example:
import numpy as np
import multiprocessing as mp
import ctypes
shared_obj = mp.RawArray(ctypes.c_double, (6, 6))
shared_arr = np.frombuffer(shared_obj)
assert type(shared_arr) == np.ndarray
assert type(shared_obj) == type(shared_arr.base)Error message:
> assert type(shared_obj) == type(shared_arr.base)
E AssertionError: assert <class 'multiprocessing.sharedctypes.c_double_Array_2'> == <class 'memoryview'>
E + where <class 'multiprocessing.sharedctypes.c_double_Array_2'> = type(<multiprocessing.sharedctypes.c_double_Array_2 object at 0x0000010E0B283940>)
E + and <class 'memoryview'> = type(<memory at 0x0000010E0921ED00>)
E + where <memory at 0x0000010E0921ED00> = array([6., 6.]).baseNumPy/Python version information:
The code example works on 1.22.3, but not 1.22.4
Reactions are currently unavailable