Paul Wise wrote:
> Package: reportbug
> Version: 7.1.6
> Severity: minor
> 
> The architecture field is currently split into two lines:
> 
> Architecture: amd64
>  (x86_64)
> 
> With earlier versions of reportbug it was only one line:
> 
> https://bugs.debian.org/823456
> Architecture: amd64 (x86_64)

Thanks for reporting this. It is only one symptom of the actual bug.
Let's fix this before we find out exactly what else was broken by my
patch in reportbug 7.1.6. Follow-up patch attached.
>From 892d6fb67fbe2e9198884e020e8f1926c7a1188b Mon Sep 17 00:00:00 2001
From: Nis Martensen <nis.marten...@web.de>
Date: Tue, 25 Apr 2017 22:30:40 +0200
Subject: [PATCH] utils.py: Avoid unwanted newlines

In contrast to subprocess.getoutput(), the new get_command_output()
function does not strip trailing newlines from the returned output.
Failure to account for this in the utils/get_arch() function caused
various subtle breakage in multiple places.

Strip newlines in get_arch() to fix the resulting problems in
bin/reportbug, reportbug/checkbuildd.py, reportbug/checkversions.py and
reportbug/debbugs.py.

In lsb_release_info(), do not add the (now unnecessary) additional
newline.
---
 reportbug/utils.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/reportbug/utils.py b/reportbug/utils.py
index e3084bb..086dd9b 100644
--- a/reportbug/utils.py
+++ b/reportbug/utils.py
@@ -783,11 +783,11 @@ def get_debian_release_info():
 
 
 def lsb_release_info():
-    return get_command_output('lsb_release -a 2>/dev/null') + '\n'
+    return get_command_output('lsb_release -a 2>/dev/null')
 
 
 def get_arch():
-    arch = get_command_output('COLUMNS=79 dpkg --print-architecture 2>/dev/null')
+    arch = get_command_output('COLUMNS=79 dpkg --print-architecture 2>/dev/null').strip()
     if not arch:
         un = os.uname()
         arch = un[4]
-- 
2.1.4

_______________________________________________
Reportbug-maint mailing list
Reportbug-maint@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reportbug-maint

Reply via email to