It is an assumption. I click on "Write to Axis" and I notice that Axis says "filtering" at the bottom right but nothing is received. I then exit the py script gui after a few minutes of waiting for it to post code and that's when axis gives the message about the % sign or M2. It could be it never got anything.
I may change the "sys.stdout.write" to create a file instead and see if it post.
There may be something else in the py script that hangs it up. These scripts all ran fine on the python version that comes with Wheezy on my other machine but they don't like Python 3 and using 2to3 doesn't fix everything.