Use "six" StringIO and BytesIO

https://pythonhosted.org/six/