From 54801289d1c29a57571c3630a438f811370d74cd Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 16 Apr 2011 21:01:53 -0400 Subject: [PATCH] Raise exceptions if bug or comment value files are missing. This happens most often when a previous crash leaves an empty directory `abc` in .be/.../bugs/abc/ or .be/.../bugs/.../comments/abc/. The new exception ensures the error message is "Bug/Comment X missing value file" which tells you where to look for the repository corruption not "summary is None" which told you nothing. --- libbe/bug.py | 3 +-- libbe/comment.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/libbe/bug.py b/libbe/bug.py index bbe6980..71682d5 100644 --- a/libbe/bug.py +++ b/libbe/bug.py @@ -641,8 +641,7 @@ class Bug (settings_object.SavedSettingsObject): def load_settings(self, settings_mapfile=None): if settings_mapfile == None: - settings_mapfile = \ - self.storage.get(self.id.storage('values'), default='\n') + settings_mapfile = self.storage.get(self.id.storage('values')) try: settings = mapfile.parse(settings_mapfile) except mapfile.InvalidMapfileContents, e: diff --git a/libbe/comment.py b/libbe/comment.py index 8ffb3cd..081ba59 100644 --- a/libbe/comment.py +++ b/libbe/comment.py @@ -611,8 +611,7 @@ class Comment (Tree, settings_object.SavedSettingsObject): if self.uuid == INVALID_UUID: return if settings_mapfile == None: - settings_mapfile = \ - self.storage.get(self.id.storage("values"), default="\n") + settings_mapfile = self.storage.get(self.id.storage('values')) try: settings = mapfile.parse(settings_mapfile) except mapfile.InvalidMapfileContents, e: -- 2.26.2