Matthew
5
See response for background:
With respect to this post:
Have you tried removing the ‘utf-8’ from .encode(), i,e.
byte_string = report_as_text.encode()
print(type(byte_string))
self.report_file = BlobMedia("text/plain", byte_string, name="report.txt")
I tried a similar print statement without the type - i.e.
print(byte_string)
which should return a binary string something like this:
b"byte_string"
which BlobMedia should return client-side . As per my post I suspect that:
text = self.report_file.get_bytes().decode()
to get_bytes() from Blob object (binary) and then .decode() into string text might do the trick.