Bug#803675: [Reportbug-maint] Bug#803675: reportbug: unable to report bug on kernel
On 01/01/2019 22.18, Sandro Tosi wrote:
>
> alternatively, we can force bugscript execution in an actual terminal,
> when using GTK, it may not be visually pleasing to see a window pop
> up, but it would be the safest way to gather all the information the
> maintainer wants via bugscripts
>
> what you think?
>
Excellent idea. Like this?
diff --git a/bin/reportbug b/bin/reportbug
index f3d1c3e..9407bca 100755
--- a/bin/reportbug
+++ b/bin/reportbug
@@ -2104,7 +2104,7 @@ For more details, please see:
http://www.debian.org/devel/wnpp/''')
# we get the return code of the script, headers and pseudo- set
# by the script, and last the text output of the script
(rc, bugscript_hdrs, bugscript_pseudo, text,
bugscript_attachments) = \
- utils.exec_and_parse_bugscript(handler, bugexec)
+ utils.exec_and_parse_bugscript(handler, bugexec, ui.system)
if rc and not notatty:
if not ui.yes_no('The package bug script %s exited with
an error status (return '
diff --git a/reportbug/utils.py b/reportbug/utils.py
index 7f90344..621b4b1 100644
--- a/reportbug/utils.py
+++ b/reportbug/utils.py
@@ -1218,13 +1218,13 @@ def get_running_kernel_pkg():
return None
-def exec_and_parse_bugscript(handler, bugscript):
+def exec_and_parse_bugscript(handler, bugscript, runner):
"""Execute and parse the output of the package bugscript, in particular
identifying the headers and pseudo-headers blocks, if present"""
fh, filename = TempFile()
fh.close()
- rc = os.system('LC_ALL=C %s %s %s' % (handler, pipes.quote(bugscript),
+ rc = runner('LC_ALL=C %s %s %s' % (handler, pipes.quote(bugscript),
pipes.quote(filename)))
isheaders = False
Reply to: