This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author yves@zioup.com
Recipients yves@zioup.com
Date 2011-02-09.14:37:16
SpamBayes Score 0.0007656397
Marked as misclassified No
Message-id <1297262237.56.0.414373883632.issue11156@psf.upfronthosting.co.za>
In-reply-to
Content
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)
.
.
.
History
Date User Action Args
2011-02-09 14:37:17yves@zioup.comsetrecipients: + yves@zioup.com
2011-02-09 14:37:17yves@zioup.comsetmessageid: <1297262237.56.0.414373883632.issue11156@psf.upfronthosting.co.za>
2011-02-09 14:37:16yves@zioup.comlinkissue11156 messages
2011-02-09 14:37:16yves@zioup.comcreate