Fix StringIO on Python 3
Merge pull request #29 from acdha/patch-1

Fix StringIO on Python 3