fix StringIO in python3