[Reportbug-commits] [SCM] Reportbug - reports bugs in the Debian distribution branch, master, updated. 4.5-27-ga4a34e7
Sandro Tosi
morph at debian.org
Mon Aug 10 18:27:38 UTC 2009
The following commit has been merged in the master branch:
commit 58ad3160999e7d98280c8f41de3eb0aaf2d17132
Author: chaica <chaica at ohmytux.com>
Date: Sun Aug 2 17:01:29 2009 +0200
detect errors returned by the mailer
diff --git a/reportbug/submit.py b/reportbug/submit.py
index de74950..b04cfb8 100644
--- a/reportbug/submit.py
+++ b/reportbug/submit.py
@@ -435,7 +435,27 @@ def send_report(body, attachments, mua, fromaddr, sendto, ccaddr, bccaddr,
ewrite("Spawning %s...\n", bit or mua)
if '%s' not in mua:
mua += ' %s'
- ui.system(mua % commands.mkarg(filename)[1:])
+ returnvalue = 0
+ succeeded = False
+ while not succeeded:
+ returnvalue = ui.system(mua % commands.mkarg(filename)[1:])
+ if returnvalue != 0:
+ ewrite("Mutt users should be aware it is mandatory to edit the draft before sending.\n")
+ mtitle = 'Sending the report has failed; What now?'
+ mopts = 'Eq'
+ moptsdesc = {'e' : 'Edit the message.',
+ 'q' : 'Quit reportbug;Will save your report for a next use.'}
+ x = ui.select_options(mtitle, mopts, moptsdesc)
+ if x == 'q':
+ failed = True
+ fh, msgname = TempFile(prefix=tfprefix)
+ fh.write(message)
+ fh.close()
+ ewrite('Original write failed, wrote bug report to %s\n', msgname)
+ succeeded = True
+ else:
+ succeeded = True
+
elif not failed and (using_sendmail or smtphost):
if kudos:
ewrite('\nMessage sent to: %s\n', sendto)
diff --git a/reportbug/ui/text_ui.py b/reportbug/ui/text_ui.py
index 6789191..9c926e3 100644
--- a/reportbug/ui/text_ui.py
+++ b/reportbug/ui/text_ui.py
@@ -74,7 +74,8 @@ def system(cmdline):
x = os.getcwd()
except OSError:
os.chdir('/')
- os.system(cmdline)
+ returnvalue = os.system(cmdline)
+ return returnvalue
def indent_wrap_text(text, starttext='', indent=0, linelen=None):
"""Wrapper for textwrap.fill to the existing API."""
--
Reportbug - reports bugs in the Debian distribution
More information about the Reportbug-commits
mailing list