python-launchpad-bug does not support proxy server

Bug #194097 reported by pranith
6
Affects Status Importance Assigned to Milestone
python-launchpad-bugs
Incomplete
Undecided
Unassigned
python-launchpad-bugs (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

Binary package hint: python-launchpad-bugs

bobby@ubuntu:~$ export http_proxy="http://10.3.100.211:8080"
bobby@ubuntu:~$ python
>>> import launchpadbugs.connector as Connector
>>> from launchpadbugs.basebuglistfilter import URLBugListFilter
>>> BugList = Connector.ConnectBugList()
>>> bl = BugList("https://bugs.launchpad.net/bughelper/+bugs")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.5/site-packages/launchpadbugs/connector.py", line 111, in __call__
    filter=self.__buglist_filter, all_tasks=self.__all_tasks)
  File "/usr/lib/python2.5/site-packages/launchpadbugs/html_buglist.py", line 123, in __init__
    all_tasks, start_bugs, BugPage)
  File "/usr/lib/python2.5/site-packages/launchpadbugs/buglistbase.py", line 85, in __init__
    self._add(self.baseurl)
  File "/usr/lib/python2.5/site-packages/launchpadbugs/buglistbase.py", line 165, in _add
    (bugs,url) = self._fetch(url)
  File "/usr/lib/python2.5/site-packages/launchpadbugs/buglistbase.py", line 150, in _fetch
    class_helper=self.class_helper_bugpage)
  File "/usr/lib/python2.5/site-packages/launchpadbugs/buglistbase.py", line 27, in __new__
    x, following_page = class_helper.find_parse_function(connection, tested_url, all_tasks)
  File "/usr/lib/python2.5/site-packages/launchpadbugs/html_buglist.py", line 33, in find_parse_function
    lp_content = connection.get(url)
  File "/usr/lib/python2.5/site-packages/launchpadbugs/http_connection.py", line 87, in get
    self.__baseurl = self._get_baseurl()
  File "/usr/lib/python2.5/site-packages/launchpadbugs/http_connection.py", line 80, in _get_baseurl
    a = self.__opener.open(BASEURL.BUG_NG + "/+").rstrip("/+")
  File "/usr/lib/python2.5/urllib2.py", line 381, in open
    response = self._open(req, data)
  File "/usr/lib/python2.5/urllib2.py", line 399, in _open
    '_open', req)
  File "/usr/lib/python2.5/urllib2.py", line 360, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.5/urllib2.py", line 1115, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "/usr/lib/python2.5/urllib2.py", line 1082, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error (111, 'Connection refused')>
>>>
bobby@ubuntu:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=7.10
DISTRIB_CODENAME=gutsy
DISTRIB_DESCRIPTION="Ubuntu 7.10"
bobby@ubuntu:~$
bobby@ubuntu:~$ dpkg -l python-launchpad-bugs | cat
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-f/Unpacked/Failed-cfg/Half-inst/t-aWait/T-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-=====================-==============-============================================
ii python-launchpad-bugs 0.2.28~gutsy1 simple Python Interface to Bugs in Launchpad

Changed in python-launchpad-bugs:
status: New → Confirmed
status: New → Confirmed
Changed in python-launchpad-bugs:
status: Confirmed → New
Revision history for this message
Brian Murray (brian-murray) wrote :

I've done some testing of this and the test case, specifically using 'export http_proxy', doesn't seem to do anything. You could use 'export http_proxy=localhost:1245' and because you are behind a proxy server you would receive the same results. While for me it just works. We need to the right way to set the proxy for python or urllib2.

Changed in python-launchpad-bugs:
status: Confirmed → Incomplete
Revision history for this message
Brian Murray (brian-murray) wrote :

It looks like

proxy_support = urllib2.ProxyHandler({"http" : "http://ahad-haam:3128"})

might work.

Revision history for this message
pranith (bobby-prani) wrote :

I tried this. It's not working...

>>> proxy_support = urllib2.ProxyHandler({"http" : "http://10.3.100.211:8080"})
>>> bl = BugList("https://bugs.launchpad.net/bughelper/+bugs")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.5/site-packages/launchpadbugs/connector.py", line 111, in __call__
    filter=self.__buglist_filter, all_tasks=self.__all_tasks)
  File "/usr/lib/python2.5/site-packages/launchpadbugs/html_buglist.py", line 123, in __init__
    all_tasks, start_bugs, BugPage)
  File "/usr/lib/python2.5/site-packages/launchpadbugs/buglistbase.py", line 85, in __init__
    self._add(self.baseurl)
  File "/usr/lib/python2.5/site-packages/launchpadbugs/buglistbase.py", line 165, in _add
    (bugs,url) = self._fetch(url)
  File "/usr/lib/python2.5/site-packages/launchpadbugs/buglistbase.py", line 150, in _fetch
    class_helper=self.class_helper_bugpage)
  File "/usr/lib/python2.5/site-packages/launchpadbugs/buglistbase.py", line 27, in __new__
    x, following_page = class_helper.find_parse_function(connection, tested_url, all_tasks)
  File "/usr/lib/python2.5/site-packages/launchpadbugs/html_buglist.py", line 33, in find_parse_function
    lp_content = connection.get(url)
  File "/usr/lib/python2.5/site-packages/launchpadbugs/http_connection.py", line 87, in get
    self.__baseurl = self._get_baseurl()
  File "/usr/lib/python2.5/site-packages/launchpadbugs/http_connection.py", line 80, in _get_baseurl
    a = self.__opener.open(BASEURL.BUG_NG + "/+").rstrip("/+")
  File "/usr/lib/python2.5/urllib2.py", line 381, in open
    response = self._open(req, data)
  File "/usr/lib/python2.5/urllib2.py", line 399, in _open
    '_open', req)
  File "/usr/lib/python2.5/urllib2.py", line 360, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.5/urllib2.py", line 1115, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "/usr/lib/python2.5/urllib2.py", line 1082, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error (111, 'Connection refused')>

Revision history for this message
Markus Korn (thekorn) wrote :

Ok, I'm far away from being a network and proxy expert, but my first guess is you need to use an https proxy, since launchpad is using https for all requests. Can you please try this:
$ export https_proxy=http://<host>:<port>
$ bugnumbers -p bughelper

and check the output (I think this will return an exception as py-lp-bugs really is not supporting proxies, but this should not be a 'connection refused' error)

Markus

Revision history for this message
pranith (bobby-prani) wrote :

This is not working... :(

bobby@ubuntu:~$ export https_proxy="http://10.3.100.211:8080"
bobby@ubuntu:~$ bugnumbers -p python-launchpad-bugs
/usr/lib/python2.5/site-packages/launchpadbugs/text_bug.py:22: FutureWarning: text_bug API not stable yet
  warnings.warn("text_bug API not stable yet", FutureWarning)
/usr/lib/python2.5/site-packages/launchpadbugs/text_buglist.py:7: FutureWarning: text_buglist API not stable yet, LP returns a list of all bugs ever reported
  warnings.warn("text_buglist API not stable yet, LP returns a list of all bugs ever reported", FutureWarning)
Maybe package 'python-launchpad-bugs' does not exist in Ubuntu.
Error while parsing 'https://bugs.launchpad.net/ubuntu/+source/python-launchpad-bugs/+bugs': "'Unknown error while loading https://bugs.launchpad.net/ubuntu/+source/python-launchpad-bugs/+bugs-text'".

Both the links https://bugs.launchpad.net/ubuntu/+source/python-launchpad-bugs/+bugs-text https://bugs.launchpad.net/ubuntu/+source/python-launchpad-bugs/+bugs
can be viewed through a standard browser.

Revision history for this message
Shimi Chen (shimi-chen) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. We are sorry that we do not always have the capacity to look at all reported bugs in a timely manner. There have been many changes in Ubuntu since that time you reported the bug and your problem may have been fixed with some of the updates. It would help us a lot if you could test it on a currently supported Ubuntu version. When you test it and it is still an issue, kindly upload the updated logs by running apport-collect 194097 and any other logs that are relevant for this particular issue.

Changed in python-launchpad-bugs:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for python-launchpad-bugs (Ubuntu) because there has been no activity for 60 days.]

Changed in python-launchpad-bugs (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.