#type error: a bytes-like object is required, not 'str' occurs when trying to write a base64 string
8 messages · Page 1 of 1 (latest)
8 messages · Page 1 of 1 (latest)
I am trying to write a base64 sstring to a file using the following method:
with open("./system/asset/key.bin", "wt") as f:
f.write(base64.b64encode(choice))
f.close()
However, this fails, and throws an error as shown in the image