From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 640466DE00C6 for ; Tue, 1 May 2018 08:24:51 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.006 X-Spam-Level: X-Spam-Status: No, score=-0.006 tagged_above=-999 required=5 tests=[AWL=0.005, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 68rvlOqPrH4t for ; Tue, 1 May 2018 08:24:50 -0700 (PDT) Received: from anarres.sindominio.net (anarres.sindominio.net [88.99.208.38]) by arlo.cworth.org (Postfix) with ESMTPS id ED26F6DE00B4 for ; Tue, 1 May 2018 08:24:49 -0700 (PDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by lesnaus.sindominio.net (Postfix) with ESMTP id C77131E43C9F; Tue, 1 May 2018 17:24:44 +0200 (CEST) Received: from anarres.sindominio.net ([127.0.0.1]) by localhost (lesnaus.sindominio.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BDbS_u9Q8tIg; Tue, 1 May 2018 17:24:43 +0200 (CEST) Received: from localhost (localhost.localdomain [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lesnaus.sindominio.net (Postfix) with ESMTPSA id F0B831E43CBE; Tue, 1 May 2018 17:24:38 +0200 (CEST) Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="pgp-sha512"; boundary="===============1025668281625079877==" MIME-Version: 1.0 Content-Disposition: inline From: meskio To: David Bremner , notmuch@notmuchmail.org References: <152485633339.1600.12264382495006409318@localhost> <20180427191527.13589-1-meskio@sindominio.net> <87o9hzfrtt.fsf@tethera.net> In-Reply-To: <87o9hzfrtt.fsf@tethera.net> Message-ID: <152518827012.10626.6946716348121434660@localhost> Subject: Re: [PATCH] python: add bindings for notmuch_message_get_propert(y/ies) Date: Tue, 01 May 2018 17:24:30 +0200 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 May 2018 15:24:51 -0000 --===============1025668281625079877== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Quoting David Bremner (2018-05-01 15:06:38) > running the test below, I get > = > Traceback (most recent call last): > File "", line 4, in > File "/home/bremner/software/upstream/notmuch/bindings/python/notmuch/m= essage.py", line 480, in get_property > value =3D c_char_p("") > TypeError: bytes or integer address expected instead of str instance Ups, I was using python2 to test it. I see it doesn't work with python thre= e. = I'll send an update. > diff --git a/test/T610-message-property.sh b/test/T610-message-property.sh > index 74b3f5a1..f7220565 100755 > --- a/test/T610-message-property.sh > +++ b/test/T610-message-property.sh > @@ -89,6 +89,18 @@ testkey2 =3D NULL > EOF > test_expect_equal_file EXPECTED OUTPUT > = > +test_begin_subtest "msg.get_property (python)" > +test_python <<'EOF' > +import notmuch > +db =3D notmuch.Database(mode=3Dnotmuch.Database.MODE.READ_WRITE) > +msg =3D db.find_message("4EFC743A.3060609@april.org") > +print("testkey1[1] =3D %s\n".format(msg.get_property("testkey1"))) I think this should be (notice the {0} instead of %s): print("testkey1[1] =3D {0}".format(msg.get_property("testkey1"))) -- = meskio | http://meskio.net/ -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-= =3D-=3D-=3D-=3D-=3D- My contact info: http://meskio.net/crypto.txt -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-= =3D-=3D-=3D-=3D-=3D- Nos vamos a Croatan. --===============1025668281625079877== MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Description: signature Content-Type: application/pgp-signature; name="signature.asc"; charset="us-ascii" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEs7M6f/ZpXzXMAQR+Urj1rJei2oYFAlrohqkACgkQUrj1rJei 2oaJSxAAj7r1lJFPzrqGy34PATiosUFOpVn61LhAPiaVUEddEAnLF9SsLGnRChcF 3QJsrE59SOQ7BwuXEOnjt4rf1s8GeG/SbhOsOec7rsCCGujCBWBjk5+pW4GLU47G 4/mdJ60IF6PMoSGhcRlQ4WgOkewcXLswWOEOvcMkQE+qfWTRb9RVa7WiqYOdYy/k JkDFJ46mr0VbO04rydk3JHQuw5XcVdJSsGTFZmwgAGE+xR1IdD6gSCSmT7K2DTLH TiWTxwe4AIO5HOiWWBTDGHGI8OaJe0ysDeEyRoBmIzAHK7EVeYYntPWuhxBKSsQG vKcTiNVR551D+2othRl28V+CLEpbOWH7wtEnV46nKQcZyyX0rU/VEu17NfcrKFOs GjpKjhJs8T3ySeooGyGYfw4//dSQ76Y8qw2tYHSFaFCNQ7BbFdEAKUcpQQOPcOEK EzpksG0Zs7fHOJpYxbVLYpqulfubfn7JpDbdyverhNF3qU9BnKBbN8dbuBGgMtu+ NIt2Dd/QAAueVnESNxXLSsfTZTBUHERvc5aGggxknMUxBjtC5k6o2POzDxbm6ly0 Kq8hH1IGnYGncRPWyVhPLuA/nJRAaU3EcSlu+hAuXL6t7DTC7zrNEB05bM+0kYpc k6z+/ociG7a2+MijllDqdwsdRu1U2bQhk17qNr40YcsMT82Ozms= =7Xp3 -----END PGP SIGNATURE----- --===============1025668281625079877==--