projects
/
notmuch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0817f0e
)
python: Bulletproof Database() path parameter
author
Sebastian Spaeth
<Sebastian@SSpaeth.de>
Thu, 16 Jun 2011 13:51:13 +0000
(15:51 +0200)
committer
Sebastian Spaeth
<Sebastian@SSpaeth.de>
Thu, 16 Jun 2011 13:51:13 +0000
(15:51 +0200)
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>
bindings/python/notmuch/database.py
patch
|
blob
|
history
diff --git
a/bindings/python/notmuch/database.py
b/bindings/python/notmuch/database.py
index 9016f0ae997d0cac1ea54af54e3fb04d71c9ee78..926bac63f5931882941238b866dc3b4ee5b14bc1 100644
(file)
--- a/
bindings/python/notmuch/database.py
+++ b/
bindings/python/notmuch/database.py
@@
-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: