I have a bunch of old email archives I'm messing around with, for example, rendering them on-demand in HTML. Some of the files use quoted printable content transfer encoding. Here's one (with a number of headers elided):
>From classicrendezvous-admin Mon Dec 4 15:29:22 2000 Message-ID: <027801bfcdaa$fa175230$268cbcd4@stewart> Reply-To: "Stewart Barrie" <sbar...@bellefield.worldonline.co.uk> From: "Stewart Barrie" <sbar...@bellefield.worldonline.co.uk> To: <classicrendezv...@bikelist.org> Date: Sat, 3 Jun 2000 23:28:00 +0100 MIME-Version: 1.0 X-StripMime: Non-text section removed by stripmime Content-Transfer-Encoding: quoted-printable Content-Type: text/plain;charset="iso-8859-1" Subject: {ClassicRend]Frame dent Just inherited a nice 531 Claud Butler from the 60's I think. No = eylelets and pencil stays. Unfortunately there is nice dent in the = middle of the seat tube just above front mech clip height. Otherwise it = seems fine.=20 Any thoughts on restoration? Are there any techniques for fixing dents = in situ (I can hear the screams already) or are we definitely looking at = a new seat tube? In which case, is it worth it? Cheers Stewart --- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html --- This message is stored in a file. I read it using email.message_from_file. In the example above, the payload still retains the quoted printable bits. Maybe it's not correctly encoded (no "=20" at the end of the second paragraph, for example), but I would have thought the email package would do what it could to decode things, but nope: >>> print(msg.get_payload()) Just inherited a nice 531 Claud Butler from the 60's I think. No = eylelets and pencil stays. Unfortunately there is nice dent in the = middle of the seat tube just above front mech clip height. Otherwise it = seems fine.=20 Any thoughts on restoration? Are there any techniques for fixing dents = in situ (I can hear the screams already) or are we definitely looking at = a new seat tube? In which case, is it worth it? Cheers Stewart --- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html --- Am I expecting too much from the email package when munching on crufty 20+yo archived email messages? Thx, Skip -- https://mail.python.org/mailman/listinfo/python-list