BytesIO replaced with StringIO