summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--b4/__init__.py10
-rw-r--r--b4/mbox.py2
2 files changed, 8 insertions, 4 deletions
diff --git a/b4/__init__.py b/b4/__init__.py
index 7e38e13..2a8bcb8 100644
--- a/b4/__init__.py
+++ b/b4/__init__.py
@@ -304,10 +304,11 @@ class LoreMailbox:
# previous revisions to current revision if patch/metadata did
# not change
pmsg.load_hashes()
- attid = pmsg.attestation.attid
- if attid not in self.trailer_map:
- self.trailer_map[attid] = list()
- self.trailer_map[attid] += trailers
+ if pmsg.attestation:
+ attid = pmsg.attestation.attid
+ if attid not in self.trailer_map:
+ self.trailer_map[attid] = list()
+ self.trailer_map[attid] += trailers
pmsg.followup_trailers += trailers
break
if not pmsg.reply:
@@ -2035,6 +2036,7 @@ def get_pi_thread_by_msgid(msgid, savefile, useproject=None, nocache=False):
tmp_mbox = mkstemp('b4-lookup-mbox')[1]
in_mbxf = get_pi_thread_by_url(t_mbx_url, tmp_mbox, nocache=nocache)
if not in_mbxf:
+ os.unlink(tmp_mbox)
return None
in_mbx = mailbox.mbox(in_mbxf)
out_mbx = mailbox.mbox(savefile)
diff --git a/b4/mbox.py b/b4/mbox.py
index 2ec74c9..a49624c 100644
--- a/b4/mbox.py
+++ b/b4/mbox.py
@@ -494,12 +494,14 @@ def main(cmdargs):
threadmbox = b4.get_pi_thread_by_msgid(msgid, savefile, useproject=cmdargs.useproject, nocache=cmdargs.nocache)
if threadmbox is None:
+ os.unlink(savefile)
return
else:
if os.path.exists(cmdargs.localmbox):
threadmbox = cmdargs.localmbox
else:
logger.critical('Mailbox %s does not exist', cmdargs.localmbox)
+ os.unlink(savefile)
sys.exit(1)
if threadmbox and cmdargs.checknewer: