I'm trying to open a pdf file in binary and encode it in base64("utf-8"), but I'm getting this ERROR message:
AttributeError: '_io.BufferedReader' object has no attribute 'b64encode'
I'm working in windows 10 and python 3, code:
attach_file_name = os.getcwd() + '\doc.pdf'
attach_file = open(attach_file_name, "rb")
attach_file = attach_file.b64encode("utf-8")