Some code:
import cStringIO def f(): buffer = cStringIO.StringIO() buffer.write(\'something\') return buffer.getvalue()
The docume
StringIO.close() is merely a convenience for routines that take a file-like and eventually attempt to close them. There is no need to do so yourself.
StringIO.close()