From: W. Trevor King Date: Sat, 21 Nov 2009 18:18:54 +0000 (-0500) Subject: Fixed bug in be-handle-mail.Message.parse_comment() for emails w/o Message-id. X-Git-Tag: 1.0.0~59^2~77^2~5 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=65bf5f8d9ddf51625d6b3b282838a9a4c71868d3;p=be.git Fixed bug in be-handle-mail.Message.parse_comment() for emails w/o Message-id. You used to get: Uncaught exception: 'NoneType' object has no attribute 'decode' File "./be-handle-mail", line 857, in main m.run() File "./be-handle-mail", line 591, in run command.run() File "./be-handle-mail", line 244, in run manipulate_encodings=False) File "/tmp/be.email-bugs/interfaces/email/interactive/libbe/cmdutil.py", line 82, in execute ret = cmd.execute([a.decode(enc) for a in args], A `print args' in Message.parse_comment() revealed [..., u'--alt-id', None,...] --- diff --git a/interfaces/email/interactive/be-handle-mail b/interfaces/email/interactive/be-handle-mail index fa80698..8831e3c 100755 --- a/interfaces/email/interactive/be-handle-mail +++ b/interfaces/email/interactive/be-handle-mail @@ -564,8 +564,10 @@ class Message (object): if mime_type == "text/plain": body = self._strip_footer(body) content_type = mime_type - args = [u"--author", author, u"--alt-id", alt_id, - u"--content-type", content_type, bug_id, u"-"] + args = [u"--author", author] + if alt_id != None: + args.extend([u"--alt-id", alt_id]) + args.extend([u"--content-type", content_type, bug_id, u"-"]) commands = [Command(self, command, args, stdin=body)] return commands def parse_control(self):