PyROOT does not support implicit conversions (although a few are programmed in by hand), so the conversion of a python str object to a TString is not made. Haven’t tested it, but calling script1( TString(“1”), TString(“2”) ) should work as expected.
okay … I tried to run with .L script1.C+ and that works fine (I found that I forgot that I do have a hard-coded converter str -> TString, given that TString is so common).
What does seem to work for me, is to use const TString& arg=“1” etc. in script1.C, both from CINT and PyROOT, both compiled and interpreted.
I’ll see what goes wrong in the by-value case (is a different converter in PyROOT than the by-ref case).
for the interpreted script, CINT needs to be told that the value it receives is already a TString since it’s checking the value (pointers are being handed around and for the compiled version, no checks are made, which is why it works as-is).
I have a fix, but want to clean it up a bit and write a few new tests. Will check-in on Monday.
a fix for the original problem that you posted is in, but it opened a can of worms, so I’m not done yet (in particular, I think there’s some behavior that’s different between compiled and interpreted in how temporaries are handled and I haven’t nailed that yet).