Thanks for noticing, this is a bug. <code>StdoutCatcher</code> is a class that is used internally to redirect output to the console UI in Pythonista. You normally don't have to worry about it.
The bug will be fixed in the next update. For now, you could replace the use of writelines in the sample code with something like this:
<pre>for line in lines:
sys.stdout.write(line + '\n')</pre>