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 sdaoden
Recipients r.david.murray, sdaoden, ysj.ray
Date 2011-04-05.15:25:47
SpamBayes Score 1.6459774e-06
Marked as misclassified No
Message-id <1302017151.57.0.404802932317.issue11605@psf.upfronthosting.co.za>
In-reply-to
Content
ysj.ray, this rude workaround manages it yet for me
(self._msg is a BytesParser() generated Message):


            if not self._msg.is_multipart():
                return
            topmost = True
            for part in self._msg.walk():
                if topmost:
                    topmost = False
                    continue
                ct = part.get_content_type()
                if not ct.startswith('text'):
                    continue

                try:
                    payload = part.get_payload()
                    charset = part.get_param('charset')
                    if charset is not None:
                        del part['content-transfer-encoding']
                        part.set_payload(payload, charset)
                except:


Note you can't simply use encoders because those break
on byte messages.
(But it would be cool if you see quopri and base64 fail
and open issues for that!)

Have fun,
Steffen
History
Date User Action Args
2011-04-05 15:25:51sdaodensetrecipients: + sdaoden, r.david.murray, ysj.ray
2011-04-05 15:25:51sdaodensetmessageid: <1302017151.57.0.404802932317.issue11605@psf.upfronthosting.co.za>
2011-04-05 15:25:47sdaodenlinkissue11605 messages
2011-04-05 15:25:47sdaodencreate