From: David Bremner <david@tethera.net>
To: Vincent A <dev@indigo.re>, notmuch@notmuchmail.org
Subject: Re: [PATCH] python: fix get_property error when property doesn't exist
Date: Fri, 01 Feb 2019 09:45:33 -0400 [thread overview]
Message-ID: <877eejlj0i.fsf@tethera.net> (raw)
In-Reply-To: <ab48b6e8-3689-4fcb-5e2d-3eaac2c22012@indigo.re>
Vincent A <dev@indigo.re> writes:
> In Python bindings, Message.get_property fails with an AttributeError
> when trying to fetch a property that doesn't exist.
> - return value.value.decode('utf-8') if value is not None else None
> + if value is None or value.value is None:
> + return None
> + return value.value.decode('utf-8')
>
Should we be throwing an appropriate exception rather than returning
None? That seems more pythonic to me. In either case we should document
the error handling.
d
next prev parent reply other threads:[~2019-02-01 13:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-27 8:40 [PATCH] python: fix get_property error when property doesn't exist Vincent A
2019-02-01 13:45 ` David Bremner [this message]
2019-02-06 19:24 ` VA
2019-02-17 11:19 ` David Bremner
2019-02-18 19:29 ` Tomi Ollila
2019-02-21 11:23 ` 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=877eejlj0i.fsf@tethera.net \
--to=david@tethera.net \
--cc=dev@indigo.re \
--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).