mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-22 17:34:54 +01:00
py3k: Fix decoding of default database name in Database._get_user_default_db
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
This commit is contained in:
parent
ae376c774e
commit
bb514d7862
1 changed files with 3 additions and 2 deletions
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue