I managed to fix this (at least for the get_bugs case) but it required changes to python-debianbts package.
I have included two patches for feedback. There are some caveats: * Other method calls need to be patched in reportbug/debbugs.py. * pysimplesoap will use alternatve http transport libraries if httplib2 is unavailable, and proxy support is unavailable for some of the other transports such as urllib2. * reportbug uses urllib2 over httplib2, and pysimplesoap uses httplib2 over urllib2, but i don't think httplib2 is a dependency of reportbug - therefore, that must changed also or pysimplesoap wont pick it up.
diff --git a/reportbug/checkversions.py b/reportbug/checkversions.py index d94bf76..c37399d 100644 --- a/reportbug/checkversions.py +++ b/reportbug/checkversions.py @@ -84,7 +84,7 @@ def get_versions_available(package, timeout, dists=None, http_proxy=None, arch=' # or to binary packages available on the current arch url += '&a=source,all,' + arch try: - page = open_url(url) + page = open_url(url, http_proxy, timeout) except NoNetwork: return {} except urllib.error.HTTPError as x: diff --git a/reportbug/debbugs.py b/reportbug/debbugs.py index 92db224..c6bd6d0 100644 --- a/reportbug/debbugs.py +++ b/reportbug/debbugs.py @@ -1069,6 +1069,13 @@ def get_reports(package, timeout, system='debian', mirrors=None, version=None, pkg_filter = 'src' else: pkg_filter = 'package' + if http_proxy: + from urllib.parse import urlparse + parsed_url = urlparse(http_proxy) + # Probably ought to use more info for the proxy, if applicable. + debianbts.set_soap_proxy(dict(proxy_host=parsed_url.hostname, + proxy_port=parsed_url.port)) + bugs = debianbts.get_bugs(pkg_filter, package) else: bugs = list(map(int, package)) diff --git a/reportbug/urlutils.py b/reportbug/urlutils.py index c16e48c..a3f2e20 100644 --- a/reportbug/urlutils.py +++ b/reportbug/urlutils.py @@ -146,6 +146,7 @@ def open_url(url, http_proxy=None, timeout=60): proxies = urllib.request.getproxies() if http_proxy: proxies['http'] = http_proxy + proxies['https'] = http_proxy try: page = urlopen(url, proxies, timeout)
debian-bts.patch
Description: Binary data