Epidermis hangs will trying to access repository

Bug #308178 reported by erlenmeyer316
4
Affects Status Importance Assigned to Milestone
Epidermis (abandoned)
Fix Released
Medium
David D Lowe

Bug Description

I am using ubuntu 8.04 and epidermis 0.2.

Here is the output from the command line

/usr/lib/python2.5/site-packages/epidermis/epidermis.py:287: GtkWarning: gdk_window_set_icon_list: icons too large
  self.win.show_all()
repoURL http://download.tuxfamily.org/epidermis/ghns/downloads.xml
Exception in thread DownloadRepoThread:
Traceback (most recent call last):
  File "/usr/lib/python2.5/threading.py", line 486, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.5/site-packages/epidermis/loadrepo.py", line 252, in run
    self.run2()
  File "/usr/lib/python2.5/site-packages/epidermis/loadrepo.py", line 273, in run2
    conn.request("GET", urlparse.urlparse(self.parent.repoURL)[2])
  File "/usr/lib/python2.5/httplib.py", line 866, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python2.5/httplib.py", line 889, in _send_request
    self.endheaders()
  File "/usr/lib/python2.5/httplib.py", line 860, in endheaders
    self._send_output()
  File "/usr/lib/python2.5/httplib.py", line 732, in _send_output
    self.send(msg)
  File "/usr/lib/python2.5/httplib.py", line 699, in send
    self.connect()
  File "/usr/lib/python2.5/httplib.py", line 683, in connect
    raise socket.error, msg
error: (113, 'No route to host')

Revision history for this message
David D Lowe (flimm) wrote :

Are you using the following repo: http://download.tuxfamily.org/epidermis/ghns/downloads.xml
Put that address under Repo URL in Settings.
Can you access the Internet normally? What happens if you open the URL above in a browser?

Changed in epidermis:
status: New → Incomplete
Revision history for this message
skaggmannen (fredrik-allansson) wrote :

I get the same error, and (for me at least) the problem is with using Epidermis through a proxy. This is related to bug 313456, but the statement that Epidermis uses urllib is wrong. In loadrepo.py it extensivly uses httplib, which does not have automatic proxy detection.

I have been trying to fix this on my own, but it seems that loadrepo.py uses the http headers to determine whether the repository has been updated and I can't see a way to convert this functionality to urllib. Any suggestions?

Revision history for this message
skaggmannen (fredrik-allansson) wrote :

OK, I found out that it can be done by using urllib2 instead of urlib. In urllib2.urlopen() you can pass a urllib2.Request object which takes HTTP headers as an argument in the constructor.

I also found out that httplib is used in managepigments.py (and possibly more places?), making it impossible to download and install themes when behind a proxy.

Revision history for this message
David D Lowe (flimm) wrote :

Well spotted skaggmannen. I used httplib in order to send headers with requests for http files. I didn't realise that the url passed to urllib2.urlopen() could be either a string or a urrlib2.Request object.
For the record, Epidermis does use urllib, it just uses httplib in addition.
The plan now is to rewrite any code that uses httplib and use urllib2 exclusively in Epidermis.

Changed in epidermis:
assignee: nobody → flimm
importance: Undecided → Medium
status: Incomplete → Triaged
Revision history for this message
David D Lowe (flimm) wrote :

A fix has been committed to the trunk, could someone with access to a proxy test it?

Changed in epidermis:
status: Triaged → Fix Committed
David D Lowe (flimm)
Changed in epidermis:
status: Fix Committed → Fix Released
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.