is it possible from python c interface to show "caret" cursor position within line of error, if I have an expression with various variables, how to find out which one is giving the error "expected string or unicode object, nonetype found"
I could extract all variables from the global dictionary and check which variables I am expecting are not there, is there any way to pinpoint the offending variable or position within the executed line of statement ?
this seems to happen after about 40,000 times I reassign global variables in a dictionary obtained as in this example https://wiki.python.org/moin/EmbeddingPythonTutorial
what caveats are there in order to be able to execute different expressions on the same dictionary, then reassign all global variables, and so on and so forth
for example
assign globals
exec expr1, expr2, expr3
reassign those same globals
exec expr1, expr2, expr3
reassign those same globals
exec expr1, expr2, expr3
my suspicion would be a reallocation of a variable in the globals dictionary somehow failed ?, but it's not apparent from PyDict_SetItemString returning always 0 correctly updated variable and the correct values ARE present in the dictionary after the alleged null value error occurs
could it be possible to set a breakpoint when the "error" is being set ? perhaps _PyThreadState_Current.curexc_type ?
update : it seems that some global variables assigned as strings to the static dictionary are internally reclassified as integer or non string, thus setting the error state "null" when attempting to retrieve them as strings hmm, I sort of patched it by retrieving the strings and "casting" to string with PyObject_Str()