code-google-com / turnip-town

Automatically exported from code.google.com/p/turnip-town
0 stars 0 forks source link

Unable to play song(linux). TypeError #92

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have added some songs to my playlist, but when I try to play them I get this 
error:

http://tinysong.com/s/%20New%20Pornographers%20Moves?format=json&limit=32
2010-12-28 09:00:16
Traceback (most recent call last):
  File "gw.py", line 1740, in OnPlayListPlayClick
    self.PlaySong(val, True)
  File "gw.py", line 1853, in PlaySong
    cs.CheckId(cs.song_id)
  File "gw.py", line 2986, in CheckId
    query_results = tinysong.Tsong().get_search_results(query_string, 32)
  File "/home/jck/gw/main_utils/tinysong.py", line 75, in get_search_results
    response = urllib2.urlopen(url_connection)
  File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 392, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 410, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 370, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 1186, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib/python2.7/urllib2.py", line 1155, in do_open
    h.request(req.get_method(), req.get_selector(), req.data, headers)
  File "/usr/lib/python2.7/httplib.py", line 941, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python2.7/httplib.py", line 975, in _send_request
    self.endheaders(body)
  File "/usr/lib/python2.7/httplib.py", line 937, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 801, in _send_output
    self.send(message_body)
  File "/usr/lib/python2.7/httplib.py", line 773, in send
    self.sock.sendall(data)
  File "/usr/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
TypeError: must be string or buffer, not dict

Original issue reported on code.google.com by jckeert...@gmail.com on 28 Dec 2010 at 3:30

GoogleCodeExporter commented 9 years ago
Same as issue #81

Original comment by M0E0G0A0...@googlemail.com on 4 Jan 2011 at 11:39

GoogleCodeExporter commented 9 years ago
This bug can be fixed by changing line 75 to:
url_connection = urllib2.Request(data_url.replace(' ', '+'), ' ', headers

Original comment by jckeert...@gmail.com on 28 Jan 2011 at 8:15

GoogleCodeExporter commented 9 years ago
Works like charm... thank u

Original comment by M0E0G0A0...@googlemail.com on 2 Feb 2011 at 1:23

GoogleCodeExporter commented 9 years ago
Updated tinysong.py. Thanks.

Original comment by 11y3y3y3...@gmail.com on 2 Feb 2011 at 2:39