My favorites | Sign in
Project Logo
                
New issue | Search
for
| Advanced search | Search tips
Issue 7: Don't work behind a proxy server
1 person starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  ----
Type-Defect
Priority-Medium


Sign in to add a comment
 
Reported by jmazzonelli, Feb 14, 2008
What steps will reproduce the problem?
1. Try the sample shown on the Project Home.
2. On the third line (u.friends) it shows the error 
3.

What is the expected output? What do you see instead?

>>> import scrobble
>>> u = scrobble.User('andrew_j_w')
>>> u.friends
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\tools\python25\Lib\site-packages\scrobble\user.py", line 158, in
__getFriends
    friends = getUserFriends(self.__username)
  File "c:\tools\python25\Lib\site-packages\scrobble\database.py", line
156, in getUserFriends
    dom = getDom(audioscrobbler_webservices, "/1.0/user/%s/friends.xml" %
(encode(username.replace(" ", "+")), ))
  File "c:\tools\python25\Lib\site-packages\scrobble\utils.py", line 53, in
getDom
    conn.request("GET", page.encode("utf8"))
  File "c:\tools\python25\Lib\httplib.py", line 862, in request
    self._send_request(method, url, body, headers)
  File "c:\tools\python25\Lib\httplib.py", line 885, in _send_request
    self.endheaders()
  File "c:\tools\python25\Lib\httplib.py", line 856, in endheaders
    self._send_output()
  File "c:\tools\python25\Lib\httplib.py", line 728, in _send_output
    self.send(msg)
  File "c:\tools\python25\Lib\httplib.py", line 695, in send
    self.connect()
  File "c:\tools\python25\Lib\httplib.py", line 679, in connect
    raise socket.error, msg
socket.error: (10061, 'Connection refused')


What version of the product are you using? On what operating system?
pyscrobble: SVN version (revision 76)
python:  2.5.1
OS:    Windows XP

 
Comment 1 by dfens270, Mar 08, 2009
    conn = httplib.HTTPConnection("proxyserver", "port")
    setStatus("Downloading " + page.encode("utf8"))
    try:
        page = "http:// + server + page
        conn.request("GET", page.encode("utf8"))

Though I think urllib2 or some other proxy aware httplib should be used rather than this.
Sign in to add a comment

Hosted by Google Code