Bug#653738: Configuration routine not run if a package specified on first run
Package: reportbug Followup-For: Bug #653738 This seems fixed to me - there is a warning printed when the configuration is skipped. The user can elect to ^C and re-run reportbug at this time. -- if utils.first_run(): if not self.args and not self.options.searchfor: offer_configuration(self.options) main() sys.exit(0) else: ewrite('Warning: no reportbug configuration found. Proceeding in %s mode.\n' % self.options.mode) -- -- Package-specific info: ** Environment settings: INTERFACE="text" ** /home/user/j/jade/.reportbugrc: reportbug_version "7.5.1" mode standard ui text realname "Kay McCormick" -- System Information: Debian Release: buster/sid APT prefers testing APT policy: (500, 'testing') Architecture: amd64 (x86_64) Kernel: Linux 4.18.0-2-amd64 (SMP w/1 CPU core) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) LSM: SELinux: enabled - Mode: Enforcing - Policy name: default Versions of packages reportbug depends on: ii apt1.8.0~alpha2 ii python33.6.7-1 ii python3-reportbug 7.5.1 ii sensible-utils 0.0.12 reportbug recommends no packages. Versions of packages reportbug suggests: pn claws-mail pn debconf-utils pn debsums ii dlocate1.07+nmu1 pn emacs24-bin-common | emacs25-bin-common ii exim4-daemon-light [mail-transport-agent] 4.91-8+b1 ii file 1:5.34-2 ii gnupg 2.2.11-1 ii python3-urwid 2.0.1-2+b1 pn reportbug-gtk ii xdg-utils 1.1.3-1 Versions of packages python3-reportbug depends on: ii apt1.8.0~alpha2 ii file 1:5.34-2 ii python33.6.7-1 ii python3-apt1.7.0 ii python3-debian 0.1.33 ii python3-debianbts 2.7.2 ii python3-requests 2.20.0-2 python3-reportbug suggests no packages. -- no debconf information
Bug#717563:
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 += '=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
Bug#717563:
debianbts.get_bugs does not support passing of proxy into SoapClient. I would try to fix this but I am not sure right now of the correct approach. pysimplesoap uses httplib2 if it is available and if a specific transport library is not specified in the call to get_http_wrapper, which it is not in this application. See patch above for other changes to reportbug to support proxy handling. Take note that the patch sets the proxy for 'https' to the proxy specified for 'http'. Reportbug itself only allows to specify a single proxy for http, so this was required to support proxying for https. Probably another argument should be added to reportbug for https proxy configuration, in order to prevent simply using the http proxy, which may not be correct. On the other hand, I believe the environment configuration could be changed (i.e. stuff the proxy information into os.environ for the duration of the reportbug session). This would reduce in fewer code changes, which can be considered a good thing. I dont know what approach people wish to take, but part of this is a defect in debianbts which is another package.