def encode_base64(msg): """Encode the message's payload in Base64. Also, add an appropriate Content-Transfer-Encoding header. """ orig = msg.get_payload() encdata = str(_bencode(orig), 'ascii') msg.set_payload(encdata) msg['Content-Transfer-Encoding'] = 'base64'
def encode_base64(msg): """Encode the message's payload in Base64. Also, add an appropriate Content-Transfer-Encoding header. """ orig = msg.get_payload(decode=True) encdata = str(_bencode(orig), 'ascii') msg.set_payload(encdata) msg['Content-Transfer-Encoding'] = 'base64'
def encode_base64(msg): """Encode the message's payload in Base64. Also, add an appropriate Content-Transfer-Encoding header. """ orig = msg.get_payload(decode=True) encdata = str(_bencode(orig), "ascii") msg.set_payload(encdata) msg["Content-Transfer-Encoding"] = "base64"
def encode_base64(msg): """Encode the message's payload in Base64. Also, add an appropriate Content-Transfer-Encoding header. """ orig = msg.get_payload() encdata = str(_bencode(orig), "ascii") msg.set_payload(encdata) msg["Content-Transfer-Encoding"] = "base64"
def myencoder(msg): """ See python issue # 11156. """ from base64 import encodebytes as _bencode orig = msg.get_payload() encdata = str(_bencode(orig), "ascii") msg.set_payload(encdata) msg["Content-Transfer-Encoding"] = "base64"
def _encode_base64(msg): """ Function to encode the message's payload in Base64. Note: It adds an appropriate Content-Transfer-Encoding header. @param msg reference to the message object (email.Message) """ orig = msg.get_payload() encdata = str(_bencode(orig), "ASCII") msg.set_payload(encdata) msg['Content-Transfer-Encoding'] = 'base64'
def encode_base64(msg): orig = msg.get_payload(decode=True) encdata = str(_bencode(orig), 'ascii') msg.set_payload(encdata) msg['Content-Transfer-Encoding'] = 'base64'