Yves Dorfsman <y...@zioup.com> added the comment:

In case this does not get fixed for a long time, here is a work around 
(re-implement the encoder yourself):


.
.
.
def myencoder(msg):
  from base64 import encodebytes as _bencode

  orig = msg.get_payload()
  encdata = str(_bencode(orig), 'ascii')
  msg.set_payload(encdata)
  msg['Content-Transfer-Encoding'] = 'base64'
.
.
.
# here is an example of how to use it
fp = 
open('/usr/share/openclipart/png/animals/mammals/happy_monkey_benji_park_01.png',
 'rb')

bindata = fp.read()

x = email.mime.image.MIMEImage(bindata, _subtype='png', _encoder=myencoder)

y = x.get_payload()
print (y)
.
.
.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue11156>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to