python: Ensure that we pass utf-8 encoded string to libnotmuch
authorMartin Owens <doctormo@gmail.com>
Fri, 16 Sep 2011 11:19:14 +0000 (13:19 +0200)
committerSebastian Spaeth <Sebastian@SSpaeth.de>
Fri, 16 Sep 2011 11:19:14 +0000 (13:19 +0200)
commit8e7a108363574ad3a342ed33a7c61c7dea65dc8a
tree752628cd22ae12e2adf12a4f9449fba4a01a3c06
parentbdaee77e1b0853b0dab00565e4c5b6164248f85a
python: Ensure that we pass utf-8 encoded string to libnotmuch

If we use unicode objects, libnotmuch would not cope with null bytes in
the byte array, so we need to make sure they are nicely formatted as
utf-8.

Introduce a helper function _str which does this throughout the code.

Patch slightly modified by Sebastian Spaeth.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
bindings/python/notmuch/database.py
bindings/python/notmuch/globals.py
bindings/python/notmuch/message.py