StringIO compatibility for python3

StringIO can be replaced with six.moves.StringIO which can provide
compatibility for Python 2 and 3. So does cStringIO.

Change-Id: Ieed1e97f1832e56717bc905114eb73fd6c4c4d04
Merge "StringIO compatibility for python3"