"creating converter" when using TTreeFormula

If I run the following program, where test.root is a root file containing a TTree with at least one entry and a Float_t valued branch called “branch0”:

import ROOT as r

f = r.TFile("test.root")
tree = f.tree

formula = r.TTreeFormula("formulaname", "branch0", tree)



I get the following message:

me@myhost:workingdir$ python minimalcase.py 
minimalcase.py:10: RuntimeWarning: creating converter for unknown type "const char**"

Everything works just fine, but it is a bit odd to have this warning message. Does a “converter” need to be manually created in order to prevent this warning from being issued? Can I do this in user code, or does it have to be included in root? If the latter, is there a way to suppress this message without suppressing other useful warnings?


it means that the python conversion saw a type “const char**” fly by (most likely because there is a public data member of that type in one of the classes in the tree) and that type can not be used because no converter is written for it in PyROOT. It not a problem unless that variable is accessed.

To suppress, add a filter through module warnings. Something like:import warnings warnings.filterwarnings( action='ignore', category=RuntimeWarning, message='creating converter.*' )
Of course, you can make the filter message even more explicit to just filter this one warning only.


Hi Wim,
Thanks! It looks like the const char** is in the arguments list for TTreeFormula::EvalInstance(Int_t i=0, const char** stringStack = 0). My code evaluates the formulas just fine, and there’s no documentation other than the code itself on what this argument can be used for, so I guess I’ll just suppress the warning.