From a9df07daad9119bf0a610af6c924dad1f8f6b90b Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Mon, 28 Mar 2016 11:31:38 +0800 Subject: [PATCH] parsemail: Fix return value for find_content error case If we fail to decode a message payload, we'll fail with the following: Traceback (most recent call last): File "./patchwork/bin/parsemail.py", line 563, in sys.exit(main(sys.argv)) File "./patchwork/bin/parsemail.py", line 553, in main return parse_mail(mail, args['list_id']) File "./patchwork/bin/parsemail.py", line 464, in parse_mail (patch, comment, filenames) = find_content(project, mail) ValueError: need more than 2 values to unpack - as the error condition for find_content only returns a 2-tuple. This change fixes the error case to the 3-tuple return type. Signed-off-by: Jeremy Kerr Acked-by: Stephen Finucane --- patchwork/bin/parsemail.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patchwork/bin/parsemail.py b/patchwork/bin/parsemail.py index f369fe4b..3147431d 100755 --- a/patchwork/bin/parsemail.py +++ b/patchwork/bin/parsemail.py @@ -231,7 +231,7 @@ def find_content(project, mail): # Could not find a valid decoded payload. Fail. if payload is None: - return (None, None) + return (None, None, None) if subtype in ['x-patch', 'x-diff']: patchbuf = payload -- 2.47.3