mirror of
https://git.notmuchmail.org/git/notmuch
synced 2025-01-03 15:21:41 +01:00
python: Bulletproof Database() path parameter
libnotmuch (and python) crashed when I accidently passed in an invalid value as path argument to the Database() instantiation. Therefore, we now check via assert that the handed in path is actually a real string (or None). Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
parent
0817f0e168
commit
995303c21b
1 changed files with 1 additions and 0 deletions
|
@ -100,6 +100,7 @@ class Database(object):
|
|||
Database._std_db_path = self._get_user_default_db()
|
||||
path = Database._std_db_path
|
||||
|
||||
assert isinstance(path, basestring), 'Path needs to be a string or None.'
|
||||
if create == False:
|
||||
self.open(path, mode)
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue