]> git.notmuchmail.org Git - notmuch/blobdiff - bindings/python/notmuch/filename.py
version: bump to 0.11.1
[notmuch] / bindings / python / notmuch / filename.py
index 077754e01c15109a76c28062a8dbfd84e5883144..f7313ec5ae856ccb008fe5ce16461e67e875faed 100644 (file)
@@ -18,7 +18,7 @@ Copyright 2010 Sebastian Spaeth <Sebastian@SSpaeth.de>'
 """
 from ctypes import c_char_p
 from notmuch.globals import (nmlib, STATUS, NotmuchError,
-    NotmuchFilenamesP, NotmuchMessagesP, NotmuchMessageP)
+    NotmuchFilenamesP, NotmuchMessageP)
 
 
 class Filenames(object):
@@ -69,7 +69,7 @@ class Filenames(object):
              reference to it, so we can automatically delete the db object
              once all derived objects are dead.
         """
-        if files_p is None:
+        if not files_p:
             raise NotmuchError(STATUS.NULL_POINTER)
 
         self._files = files_p
@@ -99,6 +99,9 @@ class Filenames(object):
         self._files = None
 
     def __str__(self):
+        return unicode(self).encode('utf-8')
+
+    def __unicode__(self):
         """Represent Filenames() as newline-separated list of full paths
 
         .. note:: As this iterates over the filenames, we will not be