[Reportbug-commits] [reportbug] 01/01: explicitly set the timeout when requesting a URL, that happens in particular when checking for newer versions; Closes: #784840

Sandro Tosi morph at moszumanska.debian.org
Fri Jan 1 23:54:56 UTC 2016


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

morph pushed a commit to branch master
in repository reportbug.

commit 5d0819fd3a8fd933a8b177bddd9c820f20f8b67b
Author: Sandro Tosi <morph at debian.org>
Date:   Fri Jan 1 23:26:39 2016 +0000

    explicitly set the timeout when requesting a URL, that happens in particular when checking for newer versions; Closes: #784840
---
 debian/changelog      | 4 +++-
 reportbug/urlutils.py | 6 +++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index eea597f..b1d74bc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -40,10 +40,12 @@ reportbug (6.6.6) UNRELEASED; urgency=medium
     - remove reference to BROWSER env variable, we use xdg-open; Closes: #690759
   * reportbug/urlutils.py
     - remove handling of X11BROWSER and CONSOLEBROWSER, obsolete
+    - explicitly set the timeout when requesting a URL, that happens in
+      particular when checking for newer versions; Closes: #784840
   * reportbug/ui/*
     - dont crash if we cant access the BTS: Closes: #694634
 
- -- Sandro Tosi <morph at debian.org>  Fri, 01 Jan 2016 19:36:06 +0000
+ -- Sandro Tosi <morph at debian.org>  Fri, 01 Jan 2016 23:25:31 +0000
 
 reportbug (6.6.5) unstable; urgency=medium
 
diff --git a/reportbug/urlutils.py b/reportbug/urlutils.py
index eaa1235..ed14796 100644
--- a/reportbug/urlutils.py
+++ b/reportbug/urlutils.py
@@ -102,7 +102,7 @@ class handlepasswd(urllib2.HTTPPasswordMgrWithDefaultRealm):
 _opener = None
 
 
-def urlopen(url, proxies=None, data=None):
+def urlopen(url, proxies=None, timeout=60, data=None):
     global _opener
 
     if not proxies:
@@ -130,7 +130,7 @@ def urlopen(url, proxies=None, data=None):
         # print _opener.handlers
         urllib2.install_opener(_opener)
 
-    return _opener.open(req)
+    return _opener.open(req, timeout=timeout)
 
 
 # Global useful URL opener; returns None if the page is absent, otherwise
@@ -145,7 +145,7 @@ def open_url(url, http_proxy=None, timeout=60):
         proxies['http'] = http_proxy
 
     try:
-        page = urlopen(url, proxies)
+        page = urlopen(url, proxies, timeout)
     except urllib2.HTTPError, x:
         if x.code in (404, 500, 503):
             return None

-- 
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