unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* UnicodeDecodeError with python API
@ 2015-03-29 13:08 Sebastian Fischmeister
  2015-03-29 16:36 ` W. Trevor King
  0 siblings, 1 reply; 4+ messages in thread
From: Sebastian Fischmeister @ 2015-03-29 13:08 UTC (permalink / raw)
  To: notmuch

Hi,

I'm trying to use the python API for notmuch, and get the following
error:

---

Traceback (most recent call last):
  File "./test.py", line 66, in <module>
    print(type(y.get_part(1)))
  File "/usr/lib/python3.4/site-packages/notmuch/message.py", line 602, in get_part
    parts = self.get_message_parts()
  File "/usr/lib/python3.4/site-packages/notmuch/message.py", line 591, in get_message_parts
    email_msg = email.message_from_file(fp)
  File "/usr/lib/python3.4/email/__init__.py", line 56, in message_from_file
    return Parser(*args, **kws).parse(fp)
  File "/usr/lib/python3.4/email/parser.py", line 54, in parse
    data = fp.read(8192)
  File "/usr/lib/python3.4/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 3447: ordinal not in range(128)

---

The code works for most messages though. How can I get around this
problem? Is it a problem in my code or the binding?

I'm using notmuch 0.19 with python 3.4.3.

Thanks,
  Sebastian

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-03-30  5:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-29 13:08 UnicodeDecodeError with python API Sebastian Fischmeister
2015-03-29 16:36 ` W. Trevor King
2015-03-29 23:10   ` Sebastian Fischmeister
2015-03-30  5:26     ` W. Trevor King

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).