diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2012-02-10 22:34:47 +0100 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2012-02-10 22:34:47 +0100 |
commit | bb514d7862aa38f6628ef1c8cb69ed5ec72098fd (patch) | |
tree | 38e6935ea7666ccbd8e21a4fab3f3c3b3983f6b0 /bindings/python/notmuch | |
parent | ae376c774ee8d8f45bae002261c425e1bc0a243a (diff) |
py3k: Fix decoding of default database name in Database._get_user_default_db
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
Diffstat (limited to 'bindings/python/notmuch')
-rw-r--r-- | bindings/python/notmuch/database.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bindings/python/notmuch/database.py b/bindings/python/notmuch/database.py index 6238b289..36b65ecb 100644 --- a/bindings/python/notmuch/database.py +++ b/bindings/python/notmuch/database.py @@ -18,6 +18,7 @@ Copyright 2010 Sebastian Spaeth <Sebastian@SSpaeth.de>' """ import os +import codecs from ctypes import c_char_p, c_void_p, c_uint, c_long, byref, POINTER from notmuch.globals import (nmlib, STATUS, NotmuchError, NotInitializedError, NullPointerError, Enum, _str, @@ -553,11 +554,11 @@ class Database(object): config = SafeConfigParser() conf_f = os.getenv('NOTMUCH_CONFIG', os.path.expanduser('~/.notmuch-config')) - config.read(conf_f) + config.readfp(codecs.open(conf_f, 'r', 'utf-8')) if not config.has_option('database', 'path'): raise NotmuchError(message="No DB path specified" " and no user default found") - return config.get('database', 'path').decode('utf-8') + return config.get('database', 'path') @property def db_p(self): |