fix s3 tests by using a BytesIO instead of StringIO