From e174881e3e39fbffa75aa0a1f858998827ad204c Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Mon, 21 Sep 2009 09:52:28 -0400 Subject: [PATCH] os.path.isdir() -> .exists() for check for "comments" file. "comments" should always be a directory if it exists, but if it is something else, be should fail rather than return an empty comment list. This fix was inspired by some browsing around in response to Thomas Habets' version of a fix for missing "bugs" directory. --- libbe/comment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libbe/comment.py b/libbe/comment.py index 19c556f..41bc7e6 100644 --- a/libbe/comment.py +++ b/libbe/comment.py @@ -128,7 +128,7 @@ def loadComments(bug, load_full=False): if bug.sync_with_disk == False: raise DiskAccessRequired("load comments") path = bug.get_path("comments") - if not os.path.isdir(path): + if not os.path.exists(path): return Comment(bug, uuid=INVALID_UUID) comments = [] for uuid in os.listdir(path): -- 2.26.2