[Reportbug-commits] [reportbug] 13/27: url_open() now returns a string, no need to read() it anymore; also replace URLError exception handling with NoNetwork; Closes: #859274

Sandro Tosi morph at moszumanska.debian.org
Mon May 29 20:14:06 UTC 2017


This is an automated email from the git hooks/post-receive script.

morph pushed a commit to branch master
in repository reportbug.

commit bd599273175cb554ccaaf8d91e795da6dfde7c09
Author: Sandro Tosi <morph at debian.org>
Date:   Mon May 29 14:03:25 2017 -0400

    url_open() now returns a string, no need to read() it anymore; also replace URLError exception handling with NoNetwork; Closes: #859274
---
 bin/querybts     | 8 ++++----
 debian/changelog | 5 ++++-
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/bin/querybts b/bin/querybts
index 229dde9..1581d63 100755
--- a/bin/querybts
+++ b/bin/querybts
@@ -168,16 +168,16 @@ def main():
                     url = debbugs.get_report_url(options.system, num, options.archived, mbox=True)
                     try:
                         report = urlutils.open_url(url, timeout=options.timeout)
-                        sys.stdout.write(report.read())
-                    except urlutils.urllib2.URLError as ex:
+                        sys.stdout.write(report)
+                    except NoNetwork as ex:
                         print("Error while accessing mbox report (%s)." % ex, file=sys.stderr)
             else:
                 num = int(m.group(1))
                 url = debbugs.get_report_url(options.system, num, options.archived, mbox=True)
                 try:
                     report = urlutils.open_url(url, timeout=options.timeout)
-                    sys.stdout.write(report.read())
-                except urlutils.urllib2.URLError as ex:
+                    sys.stdout.write(report)
+                except NoNetwork as ex:
                     print("Error while accessing mbox report (%s)." % ex, file=sys.stderr)
                     sys.exit(1)
         return
diff --git a/debian/changelog b/debian/changelog
index 778317a..2724496 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -20,8 +20,11 @@ reportbug (7.1.7) UNRELEASED; urgency=medium
       Closes: #855973
   * reportbug/bugreport.py
     - add LANGUAGE env var to locales bugreport section; Closes: #840898
+  * bin/querybts
+    - url_open() now returns a string, no need to read() it anymore; also
+      replace URLError exception handling with NoNetwork; Closes: #859274
 
- -- Sandro Tosi <morph at debian.org>  Mon, 29 May 2017 13:14:45 -0400
+ -- Sandro Tosi <morph at debian.org>  Mon, 29 May 2017 14:02:39 -0400
 
 reportbug (7.1.6) unstable; urgency=medium
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reportbug/reportbug.git



More information about the Reportbug-commits mailing list