unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Antoine Amarilli <antoine.amarilli@ens.fr>
To: notmuch@notmuchmail.org
Subject: python-notmuch decoding error on a message
Date: Sun, 06 Nov 2011 22:16:03 -0000	[thread overview]
Message-ID: <20111106221554.GA23240@clipper.ens.fr> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 355 bytes --]

Hello,

The attached message makes python-notmuch crash when trying to access it (see
attached log).

I don't know if the encoding of Subject is valid or not, but it would probably
be better anyway to ignore decoding errors and return some approximation of
Subject instead of failing like this.

Any ideas?

Thanks!

-- 
Antoine Amarilli


[-- Attachment #1.2: log --]
[-- Type: text/plain, Size: 902 bytes --]

$ python
Python 2.7.2+ (default, Aug 16 2011, 09:23:59) 
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import notmuch
>>> db = notmuch.Database()
>>> q = db.create_query("id:test20110928121705.GA3877@example.com")
>>> t = q.search_threads()
>>> for a in t:
...     print a
... 
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "/usr/local/lib/python2.7/dist-packages/notmuch/thread.py", line 379, in __str__
    thread['subject'] = self.get_subject()
  File "/usr/local/lib/python2.7/dist-packages/notmuch/thread.py", line 311, in get_subject
    return subject.decode('UTF-8')
  File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xe8 in position 6: invalid continuation byte
>>> 

[-- Attachment #1.3: message --]
[-- Type: text/plain, Size: 462 bytes --]

Date: Wed, 28 Sep 2011 14:17:05 +0200
From: nobody@example.com
To: nobody@example.com
Subject: Re: Fwd: =?utf-8?B?M+ht?= =?utf-8?Q?e?= Salon du Livre juridique
Message-ID: <test20110928121705.GA3877@example.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="ZGiS0Q5IWpPtfppv"
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
Content-Length: 865
Lines: 2

test


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

             reply	other threads:[~2011-11-06 22:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-06 22:16 Antoine Amarilli [this message]
2011-11-24 16:13 ` python-notmuch decoding error on a message David Bremner
2011-11-25  9:04   ` Patrick Totzke
2011-11-25 12:15     ` David Bremner
2011-12-01 21:30   ` Sebastian Spaeth
2012-11-06  1:50 ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111106221554.GA23240@clipper.ens.fr \
    --to=antoine.amarilli@ens.fr \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).