This looks like an error when parsing output from Python, mistaking input for output. (How we ended up parsing a buffer containing both input, output and prompts intermingled is anyone's guess -- it doesn't look like a very reliable way of doing it, and evidently isn't.)