SystemError:null argument to internal routine

Fredrik Lundh fredrik at pythonware.com
Thu Apr 5 13:10:19 EDT 2001


Erik  Wilsher wrote:
> I'm developing a program using python and the metakit wrapper Mk4py.
> When running a large test case I get the error message:
>
> SystemError:null argument to internal routine
>
> The traceback indicates that this happens in a comparison operation
> between two floating point numbers in python.

(one of which is -1?)

bogus exceptions usually appear when some C routine sets
the exception state, but doesn't flag the error back to Python.

(C code that masks errors *must* call PyErr_Clear() before
returning to Python)

to check if this is the case, add "getattr(None, "spam")" just
before the offending line:

    getattr(None, "spam") # reset error state
    some statement that raises an unexpected exception

if the error goes away, you have a broken C module some-
where...

Cheers /F





More information about the Python-list mailing list