use method-local rather than instance-local StringIO