python notmuch2 bindings exclude_tags not added correctly to query

classic Classic list List threaded Threaded
3 messages Options
Johannes Larsen Johannes Larsen
Reply | Threaded
Open this post in threaded view
|

python notmuch2 bindings exclude_tags not added correctly to query

A typo in Database._create_query loses the exclude_tag names during the
string to utf-8 conversion.


The problem is fixed by this patch applied to current master (ced341e8):

diff --git i/bindings/python-cffi/notmuch2/_database.py w/bindings/python-cffi/notmuch2/_database.py
index 5ab0f20a..868f4408 100644
--- i/bindings/python-cffi/notmuch2/_database.py
+++ w/bindings/python-cffi/notmuch2/_database.py
@@ -581 +581 @@ class Database(base.NotmuchObject):
-                    tag = str.encode('utf-8')
+                    tag = tag.encode('utf-8')

--
johs (Johannes Larsen), (+47) 41435451
_______________________________________________
notmuch mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]

signature.asc (849 bytes) Download Attachment
Floris Bruynooghe Floris Bruynooghe
Reply | Threaded
Open this post in threaded view
|

Re: python notmuch2 bindings exclude_tags not added correctly to query

Hi Johannes,

On Wed 23 Dec 2020 at 02:34 +0100, Johannes Larsen wrote:

> A typo in Database._create_query loses the exclude_tag names during the
> string to utf-8 conversion.
>
>
> The problem is fixed by this patch applied to current master (ced341e8):
>
> diff --git i/bindings/python-cffi/notmuch2/_database.py w/bindings/python-cffi/notmuch2/_database.py
> index 5ab0f20a..868f4408 100644
> --- i/bindings/python-cffi/notmuch2/_database.py
> +++ w/bindings/python-cffi/notmuch2/_database.py
> @@ -581 +581 @@ class Database(base.NotmuchObject):
> -                    tag = str.encode('utf-8')
> +                    tag = tag.encode('utf-8')

Oops yes, someone else found this a while ago and I started working on a
patch but that ended up in some yak shaving when the tests I wrote for
it ended up accidentally unearthing other unrelated bugs and then I lost
track of this...  Apologies.

Anyway, this fix LGTM even if I do prefer fixes to come with tests :)  But that
shouldn't stop a fix from being merged I guess.

Cheers
Floris
_______________________________________________
notmuch mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|

Re: python notmuch2 bindings exclude_tags not added correctly to query

In reply to this post by Johannes Larsen
Johannes Larsen <[hidden email]> writes:

> A typo in Database._create_query loses the exclude_tag names during the
> string to utf-8 conversion.
>
>
> The problem is fixed by this patch applied to current master (ced341e8):
>
> diff --git i/bindings/python-cffi/notmuch2/_database.py w/bindings/python-cffi/notmuch2/_database.py
> index 5ab0f20a..868f4408 100644
> --- i/bindings/python-cffi/notmuch2/_database.py
> +++ w/bindings/python-cffi/notmuch2/_database.py
> @@ -581 +581 @@ class Database(base.NotmuchObject):
> -                    tag = str.encode('utf-8')
> +                    tag = tag.encode('utf-8')
>
> --

Thanks for the fix. I've included it in release 0.31.3.

If you could use "git send-email" (or at least "git format-patch") for
future contributions, that would decrease that chance if my bungling
things.

Thanks again,

David
_______________________________________________
notmuch mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]