Replace io.BytesIO with six.BytesIO for py2.6/2.7 and one StringIO with BytesIO
Merge pull request #326 from interru/py2-fix

Replace io.BytesIO with six.BytesIO for py2.6/2.7