Skip to content

Gaudi::Utils::toStream does not handle correctly strings with both single and double quotes

For example, in Python:

>>> import cppyy
>>> cppyy.gbl.gSystem.Load('libGaudiKernel.so')
0
>>> cppyy.gbl.gInterpreter.Declare('#include <GaudiKernel/ToStream.h>')
True
>>> print(cppyy.gbl.Gaudi.Utils.toString(cppyy.gbl.std.string('''a'"b"'c''')))
"a'"b"'c"

while the correct output should be either "a'"b"'c" or (preferred) 'a\'"b"\'c':

>>> print(repr('''a'"b"'c'''))
'a\'"b"\'c'
Edited by Marco Clemencic
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information