--- /dev/null
+Return-Path: <wking@tremily.us>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 79437431FBF\r
+ for <notmuch@notmuchmail.org>; Sun, 29 Mar 2015 22:29:02 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 2.338\r
+X-Spam-Level: **\r
+X-Spam-Status: No, score=2.338 tagged_above=-999 required=5\r
+ tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+ DNS_FROM_AHBL_RHSBL=2.438, RCVD_IN_DNSWL_NONE=-0.0001]\r
+ autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id tmuG3yIFMfl1 for <notmuch@notmuchmail.org>;\r
+ Sun, 29 Mar 2015 22:28:56 -0700 (PDT)\r
+Received: from resqmta-po-05v.sys.comcast.net (resqmta-po-05v.sys.comcast.net\r
+ [96.114.154.164])\r
+ (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id AF391431FAE\r
+ for <notmuch@notmuchmail.org>; Sun, 29 Mar 2015 22:28:55 -0700 (PDT)\r
+Received: from resomta-po-01v.sys.comcast.net ([96.114.154.225])\r
+ by resqmta-po-05v.sys.comcast.net with comcast\r
+ id 9hUu1q0014s37d401hUuw4; Mon, 30 Mar 2015 05:28:54 +0000\r
+Received: from odin.tremily.us ([67.168.81.176])\r
+ by resomta-po-01v.sys.comcast.net with comcast\r
+ id 9hSs1q00A3oF5yT01hSsVG; Mon, 30 Mar 2015 05:26:54 +0000\r
+Received: by odin.tremily.us (Postfix, from userid 1000)\r
+ id EC07E16F8071; Sun, 29 Mar 2015 22:26:51 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tremily.us; s=odin;\r
+ t=1427693211; bh=Jp/untkSO9O2zjt3gTGzIm69gcEKhGrC/KVtFAygSqY=;\r
+ h=Date:From:To:Cc:Subject:References:In-Reply-To;\r
+ b=V1wiJ5Vm0J1kkqDscyfp5v34UciutSH9FMW1lKguUTF8z3c2oRZPyJIpYGVUAas18\r
+ 68xXcQrBrQ24ZPFSa1LndQiyQ1/Zj+/kg8AyTfwuOUdlmy6Qa3nT7/qwhRZNi8AdP5\r
+ XMoKP092vX0tOqtBR7sFhfljD0fZW3OIR7no3EQA=\r
+Date: Sun, 29 Mar 2015 22:26:51 -0700\r
+From: "W. Trevor King" <wking@tremily.us>\r
+To: Sebastian Fischmeister <sfischme@uwaterloo.ca>\r
+Subject: Re: UnicodeDecodeError with python API\r
+Message-ID: <20150330052651.GS22036@odin.tremily.us>\r
+References: <874mp4q7e7.fsf@uwaterloo.ca>\r
+ <20150329163658.GK22036@odin.tremily.us>\r
+ <87ego7pfia.fsf@uwaterloo.ca>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; micalg=pgp-sha1;\r
+ protocol="application/pgp-signature"; boundary="vSzmLLrdioqyxIBH"\r
+Content-Disposition: inline\r
+In-Reply-To: <87ego7pfia.fsf@uwaterloo.ca>\r
+OpenPGP: id=39A2F3FA2AB17E5D8764F388FC29BDCDF15F5BE8;\r
+ url=http://tremily.us/pubkey.txt\r
+User-Agent: Mutt/1.5.23 (2014-03-12)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net;\r
+ s=q20140121; t=1427693334;\r
+ bh=ZLlalfBAUD2HcSb1rb6a9XSYwlKCk342wNtpu3Oh9jM=;\r
+ h=Received:Received:Received:Date:From:To:Subject:Message-ID:\r
+ MIME-Version:Content-Type;\r
+ b=Vk0Zx+blGwRXlFoLN9FG+kw6m3YT+GG7Xdq0R9yefDvp3g8QZtHiz+m/RqrSrbq5P\r
+ FT56oT+KJnVgi0xG5pKTdl7DkvVwbP0PiKFD0Kan+PawR4Y2ABNZx/K+I6e/jUKGn0\r
+ EF6dZmgKEg185XPo8Gm2mXVQr2+Qmy+tdJUrSU+h9nchQHgMGwTIJ1c7t1QSjesr/H\r
+ twdKzu079jt1RAhEz18TLd8ErSU3l2IK92ix3zQXEbRcWzjdD99Id6TiTumM2O0znZ\r
+ 6jUxeKYUCmCIwiDWwdzx6xvyIzGPxOiPzJVC9Tq648tyTBgr44G0N0GsvHq3v2SHwW\r
+ sF5vhcBMxmIlA==\r
+Cc: notmuch <notmuch@notmuchmail.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 30 Mar 2015 05:29:04 -0000\r
+\r
+\r
+--vSzmLLrdioqyxIBH\r
+Content-Type: text/plain; charset=utf-8\r
+Content-Disposition: inline\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+On Sun, Mar 29, 2015 at 07:10:53PM -0400, Sebastian Fischmeister wrote:\r
+> > My first guess is that the file's encoding doesn't match your\r
+> > locale. Do you have a non-ASCII locale set? You can check with:\r
+>=20\r
+> It seems to be more tricky than I thought. I didn't have a locale set.\r
+>=20\r
+> When I set one, I can parse some emails with this:\r
+>=20\r
+> export LANG=3Den_US.latin-1\r
+>=20\r
+> Others with this:\r
+>=20\r
+> export LANG=3Den_US.UTF-8\r
+>=20\r
+> Others fail with either of the two.\r
+\r
+Hmm, that's surprising. In hindsight, the locale should only be\r
+affecting the *output* (e.g., a non-Unicode locale might cause a\r
+UnicodeEncodeError). However, you're getting your errors on input.\r
+I'd expect the files to be loaded and parsed as byte-streams, but\r
+maybe there's a bug in Python's email parser. It wouldn't be the\r
+first time it's had trouble with bytes-vs-Unicode (see these old bugs\r
+with similar tracebacks from the initial transition to 3.0 [1,2], or\r
+search =E2=80=9Cunicode email=E2=80=9D on http://bugs.python.org/). I'd tr=\r
+y to\r
+reproduce this failure by calling email.message_from_file(=E2=80=A6) direct=\r
+ly\r
+(getting notmuch out of the loop), and then file a bug against Python\r
+once you have a pure-Python reproduction.\r
+\r
+Cheers,\r
+Trevor\r
+\r
+[1]: http://bugs.python.org/issue1086\r
+[2]: http://bugs.python.org/issue1258#msg56470\r
+\r
+--=20\r
+This email may be signed or encrypted with GnuPG (http://www.gnupg.org).\r
+For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy\r
+\r
+--vSzmLLrdioqyxIBH\r
+Content-Type: application/pgp-signature; name="signature.asc"\r
+Content-Description: OpenPGP digital signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v2\r
+\r
+iQIcBAEBAgAGBQJVGN6ZAAoJEG8/JgBt8ol81h0P/2Gcb33fy+HnXdaZTa4fWAg7\r
+ylyHLfa0UUv3MasF92a4MB6jnEMcQhgKfnAr0Tp3z/N0R2UXk6n6upetTwr5pLk1\r
+zyJX5MSk2aEedyjh3n9lid0z75sGjqygEsTppUCTkidLeFQzWFB4j2tdH+xKVcOU\r
+/HXmgcmDlh+HtOu1DRSIEETQxio1LiPBqUXFKZ/FGDlornAlFbBViX1XZaudj+9A\r
+/LeyD92SYkRiDaUvKpogFBpM0pClxSUzezXfIVRho18nwft5tmmatGgIWLMrntsD\r
+iaBLAqJcjUPgYuhcxtVAC4JAk+L2IWaJr4HuufN1UfLu5Uj5IwUvaIjFevkblMkl\r
+0RQ2Hf8IhueN59d+QtbGbRiWHJBbf6PfBDXHukkeQSvrYjkwiJi2hoiLnJ4OhhDn\r
+3wkVKyIp0fGZwsq1xTySFqlqd8rTGOG9vhnHYYDEurr5+AXYARH6/33MoprVjrhc\r
+gdtSZJfPhvj1mv2ilTBWOsVOV9/ar3qOMD3dhjqhQvxprghknUf63y7L7e1FwFKx\r
+Uj9LA1tbI2wxiX4enWSUeYxkjQU8bDwHaOmxBl7OUPiOtq7zNnGnfLBFSqJ/NVUM\r
+f7fZlBajQkoMuwuYgcPnwGp0C//RUNpIreCqSbzB9hi6D/hY5Wqas8ax3Pm4jrx4\r
+a8akA1PFycrAaIj79HTV\r
+=lybv\r
+-----END PGP SIGNATURE-----\r
+\r
+--vSzmLLrdioqyxIBH--\r