More of a note to myself:

You just cannot (I guess because of lacking proper pickling C API support) pickle cStringIO.StringIO instances. Use StringIO.StringIO instead.