Daniel Shahaf wrote:
> 
> The .splitlines() calls returns a list of strings that do *not* contain
> newlines (\n characters), and the following .write() does not add its own 
> \n's.

Oops. That was me. Thanks for finding, debugging and reporting this!

Patch attached.
>From 7b0f010797dc8ad52838604bb9eb3de9e3f5d9a3 Mon Sep 17 00:00:00 2001
From: Nis Martensen <[email protected]>
Date: Fri, 30 Jun 2017 23:19:32 +0200
Subject: [PATCH] Add line endings when processing strings line by line

Bug introduced in d7e9eb8cc5d2efa4543bd35a806cbc36d7419e5e
---
 reportbug/debbugs.py | 4 ++--
 reportbug/utils.py   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/reportbug/debbugs.py b/reportbug/debbugs.py
index f2e5830..eade68a 100644
--- a/reportbug/debbugs.py
+++ b/reportbug/debbugs.py
@@ -969,7 +969,7 @@ def parse_html_report(number, url, http_proxy, timeout, followups=False, cgi=Tru
 
     parser = BTSParser(cgi=cgi, followups=followups)
     for line in page.splitlines():
-        parser.feed(line)
+        parser.feed(line + '\n')
     parser.close()
 
     items = parser.preblock
@@ -1121,7 +1121,7 @@ def get_reports(package, timeout, system='debian', mirrors=None, version=None,
 
         parser = BTSParser()
         for line in page.splitlines():
-            parser.feed(line)
+            parser.feed(line + '\n')
         parser.close()
 
         return parser.bugcount, parser.title, parser.hierarchy
diff --git a/reportbug/utils.py b/reportbug/utils.py
index 8139668..3e53a3c 100644
--- a/reportbug/utils.py
+++ b/reportbug/utils.py
@@ -1205,7 +1205,7 @@ def launch_mbox_reader(cmd, url, http_proxy, timeout):
     (fd, fname) = TempFile()
     try:
         for line in mbox.splitlines():
-            fd.write(line)
+            fd.write(line + '\n')
         fd.close()
         if cmd is not None:
             try:
-- 
2.1.4

_______________________________________________
Reportbug-maint mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reportbug-maint

Reply via email to