I am running PyModel based JSON generator. We may have various control sequences in JSON and the model will escape them, when writing the output. However, the generated module source code does not respect them.
The following patch helped me:
f.write(' (%s, %s, %s),\n' % (aname, args, repr(qResult[1:-1])))