Just rely on json.dumps() '\n' for replacement.