Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upCan't pickle UFuncTypeError #16490
Can't pickle UFuncTypeError #16490
Comments
|
The error seems to come from: I can't help feeling there's a bug in the error message formatting here by python itself. |
|
Ah, I see the problem now. It's import pickle
from numpy.core._exceptions import _UFuncNoLoopError
pickle.dumps(_UFuncNoLoopError) |
|
Hmmm, do we have to set the qualname as well to make printing nice? |
|
If we want to keep digging, we could attach a metaclass to override pickling... |
|
I would prefer if we can avoid it if it has no big issues (not sure if we can set a pickler externally, but I guess that is also type based). Printing seems fine without qualname, since it seems to rely on |
|
It sounds like we want to drop both of these lines then: numpy/numpy/core/_exceptions.py Lines 29 to 30 in fb314a3 |
|
I tried, and it pickles if I just drop the qualname, so maybe its fine? |
|
The module setting is currently a no-op anyway, but in all the cases when it isn't it would also break pickling. |
|
This also happens with |
|
Hmmm, is this urgent enough to be fixed for 1.19.3? It seems like this may be problematic in some schemes of multiprocessing! |


numpy 1.18.4-py38h8854b6b_0 (conda-forge)
Linux x64
Output: