Description
the function __Pyx_PyNumber_IntOrLong
from cython raises an exception when the conversion fails. On CPython, this will always be a TypeError
from line 314, but on other implementations i.e. PyPy the call to PyNumber_Int
on line 298 raises a ValueError
upon failure.
Pandas catches only a TypeError
. The easiest fix would be for pandas to catch both TypeError
and ValueError
when conversion fails, a harder fix would be to change cython to raise a ValueError on CPython as well, and then fix all the downstream libraries that use it (Or to scope the call to PyNumber_Int
and convert the exception, and then require a minimum cython version for pandas-on-PyPy).
I already have the fix for catching multiple exceptions, should I issue a pull request for that?