UnicodeDecodeError with python API
[notmuch-archives.git] / 40 / b9ee226bb2f7ff70b87b4ae6988bfd325fece8
diff --git a/40/b9ee226bb2f7ff70b87b4ae6988bfd325fece8 b/40/b9ee226bb2f7ff70b87b4ae6988bfd325fece8
new file mode 100644 (file)
index 0000000..cd410c7
--- /dev/null
@@ -0,0 +1,97 @@
+Return-Path: <sebastian.fischmeister@uwaterloo.ca>\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 CFC14431FBF\r
+       for <notmuch@notmuchmail.org>; Sun, 29 Mar 2015 06:08:34 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.138\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.138 tagged_above=-999 required=5\r
+       tests=[DNS_FROM_AHBL_RHSBL=2.438, RCVD_IN_DNSWL_MED=-2.3]\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 GnYdSN9mr357 for <notmuch@notmuchmail.org>;\r
+       Sun, 29 Mar 2015 06:08:31 -0700 (PDT)\r
+Received: from mailchk-m01.uwaterloo.ca (mailservices.uwaterloo.ca\r
+       [129.97.128.141])\r
+       (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 94F02431FAE\r
+       for <notmuch@notmuchmail.org>; Sun, 29 Mar 2015 06:08:31 -0700 (PDT)\r
+Received: from connect.uwaterloo.ca (connhub1.connect.uwaterloo.ca\r
+       [129.97.149.113])\r
+       by mailchk-m01.uwaterloo.ca (8.14.4/8.14.4) with ESMTP id\r
+       t2TD8Smj001215\r
+       (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=OK)\r
+       for <notmuch@notmuchmail.org>; Sun, 29 Mar 2015 09:08:29 -0400\r
+Received: from CONNHUB4.connect.uwaterloo.ca (129.97.149.122) by\r
+       connhub1.connect.uwaterloo.ca (129.97.149.113) with Microsoft SMTP\r
+       Server (TLS) id 14.3.210.2; Sun, 29 Mar 2015 09:08:28 -0400\r
+Received: from uwaterloo.ca (172.16.37.102) by connhub4.connect.uwaterloo.ca\r
+       (129.97.149.122) with Microsoft SMTP Server (TLS) id 14.3.210.2;\r
+       Sun, 29 Mar 2015 09:08:28 -0400\r
+From: Sebastian Fischmeister <sfischme@uwaterloo.ca>\r
+To: notmuch <notmuch@notmuchmail.org>\r
+Subject: UnicodeDecodeError with python API\r
+X-Homepage: http://esg.uwaterloo.ca\r
+Date: Sun, 29 Mar 2015 09:08:28 -0400\r
+Message-ID: <874mp4q7e7.fsf@uwaterloo.ca>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-UUID: 49d3b0a5-5c20-4aea-8eb9-f5939f33af50\r
+X-Miltered: at mailchk-m01 with ID 5517F94C.000 by Joe's j-chkmail\r
+       (http://j-chkmail.ensmp.fr)!\r
+X-Virus-Scanned: clamav-milter 0.98.6 at mailchk-m01\r
+X-Virus-Status: Clean\r
+X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3\r
+       (mailchk-m01.uwaterloo.ca [129.97.128.141]);\r
+       Sun, 29 Mar 2015 09:08:29 -0400 (EDT)\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+Reply-To: sfischme@uwaterloo.ca\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: Sun, 29 Mar 2015 13:08:35 -0000\r
+\r
+Hi,\r
+\r
+I'm trying to use the python API for notmuch, and get the following\r
+error:\r
+\r
+---\r
+\r
+Traceback (most recent call last):\r
+  File "./test.py", line 66, in <module>\r
+    print(type(y.get_part(1)))\r
+  File "/usr/lib/python3.4/site-packages/notmuch/message.py", line 602, in get_part\r
+    parts = self.get_message_parts()\r
+  File "/usr/lib/python3.4/site-packages/notmuch/message.py", line 591, in get_message_parts\r
+    email_msg = email.message_from_file(fp)\r
+  File "/usr/lib/python3.4/email/__init__.py", line 56, in message_from_file\r
+    return Parser(*args, **kws).parse(fp)\r
+  File "/usr/lib/python3.4/email/parser.py", line 54, in parse\r
+    data = fp.read(8192)\r
+  File "/usr/lib/python3.4/encodings/ascii.py", line 26, in decode\r
+    return codecs.ascii_decode(input, self.errors)[0]\r
+UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 3447: ordinal not in range(128)\r
+\r
+---\r
+\r
+The code works for most messages though. How can I get around this\r
+problem? Is it a problem in my code or the binding?\r
+\r
+I'm using notmuch 0.19 with python 3.4.3.\r
+\r
+Thanks,\r
+  Sebastian\r