fixed StringIO import for Python 3