>
> 1. Fire up a terminal and go to the directory of the audioscrobbler
> plugin (where __init__.py and all the others are located)
>
> 2. Launch the python interactive console
>
> 3. Import _scrobbler
>
> 4. Try _scrobbler.login($username, $password_hash, hashpw=False,
> post_url='http://post.audioscrobbler.com/')
>
> 5. Try _scrobbler.login($username, $password, hashpw=True,
> post_url='http://post.audioscrobbler.com/')
>
> Both 4. and 5. should yield no exceptions.
>
It depend on the network I'm using. At home no problems, at work: (after
modifying default post_url value of login() to have http://):
In [17]: _scrobbler.login("jitg", pw, hashpw=True)
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (105, 0))
/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.pyc
in _open(self, req, data)
397 protocol = req.get_type()
398 result = self._call_chain(self.handle_open, protocol,
protocol +
--> 399 '_open', req)
400 if result:
401 return result
/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.pyc
in _call_chain(self, chain, kind, meth_name, *args)
358 func = getattr(handler, meth_name)
359
--> 360 result = func(*args)
361 if result is not None:
362 return result
/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/httplib.pyc
in begin(self)
383 # read until we get a non-100 response
384 while True:
--> 385 version, status, reason = self._read_status()
386 if status != CONTINUE:
387 break
/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/httplib.pyc
in _read_status(self)
347 # Presumably, the server closed the connection before
348 # sending a valid response.
--> 349 raise BadStatusLine(line)
350 try:
351 [version, status, reason] = line.split(None, 2)
BadStatusLine:
All this were fired in a row.
Looks like urllib2 has trouble with networking here...
I'm hooked to a switch which is hooked to another switch shich has adsl
modem connected to it.
Hi Mathias,
On Wed, 29 Jul 2009, Mathias Brodala wrote:
> login($ username, $password_hash, hashpw=False, post.audioscrob bler.com/ ') login($ username, $password, hashpw=True, post.audioscrob bler.com/ ')
> 1. Fire up a terminal and go to the directory of the audioscrobbler
> plugin (where __init__.py and all the others are located)
>
> 2. Launch the python interactive console
>
> 3. Import _scrobbler
>
> 4. Try _scrobbler.
> post_url='http://
>
> 5. Try _scrobbler.
> post_url='http://
>
> Both 4. and 5. should yield no exceptions.
>
It depend on the network I'm using. At home no problems, at work: (after
modifying default post_url value of login() to have http://):
In [15]: _scrobbler. login(" jitg", pw, hashpw=True, post.audioscrob bler.com/ ' ) f58c1ee537c2c42 05e', post.audioscrob bler.com: 80/np_1. 2', post2.audioscro bbler.com: 80/protocol_ 1.2', '']
post_url='http://
['OK', '7a237448f6a942
'http://
'http://
In [16]: _scrobbler. login(" jitg", pw, hashpw=True, post.audioscrob bler.com/ ' )
post_url='http://
['']
In [17]: _scrobbler. login(" jitg", pw, hashpw=True)
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (105, 0))
------- ------- ------- ------- ------- ------- ------- ------- ------- ------- -----
BadStatusLine Traceback (most recent call
last)
/Users/ jack/exaile_ bazaar/ exaile/ plugins/ audioscrobbler/ <ipython console>
in <module>()
/Users/ jack/exaile_ bazaar/ exaile/ plugins/ audioscrobbler/ _scrobbler. py in urlencode( values) Request( "%s?%s" % (url, data) ) urlopen( req)
login(user, password, hashpw, client, post_url)
85 data = urllib.
86 req = urllib2.
---> 87 response = urllib2.
88 result = response.read()
89 lines = result.split('\n')
/opt/local/ Library/ Frameworks/ Python. framework/ Versions/ 2.5/lib/ python2. 5/urllib2. pyc opener( opener) :
in urlopen(url, data)
122 if _opener is None:
123 _opener = build_opener()
--> 124 return _opener.open(url, data)
125
126 def install_
/opt/local/ Library/ Frameworks/ Python. framework/ Versions/ 2.5/lib/ python2. 5/urllib2. pyc
in open(self, fullurl, data)
379 req = meth(req)
380
--> 381 response = self._open(req, data)
382
383 # post-process response
/opt/local/ Library/ Frameworks/ Python. framework/ Versions/ 2.5/lib/ python2. 5/urllib2. pyc chain(self. handle_ open, protocol,
in _open(self, req, data)
397 protocol = req.get_type()
398 result = self._call_
protocol +
--> 399 '_open', req)
400 if result:
401 return result
/opt/local/ Library/ Frameworks/ Python. framework/ Versions/ 2.5/lib/ python2. 5/urllib2. pyc
in _call_chain(self, chain, kind, meth_name, *args)
358 func = getattr(handler, meth_name)
359
--> 360 result = func(*args)
361 if result is not None:
362 return result
/opt/local/ Library/ Frameworks/ Python. framework/ Versions/ 2.5/lib/ python2. 5/urllib2. pyc open(httplib. HTTPConnection, req) dler.do_ request_
in http_open(self, req)
1105
1106 def http_open(self, req):
-> 1107 return self.do_
1108
1109 http_request = AbstractHTTPHan
/opt/local/ Library/ Frameworks/ Python. framework/ Versions/ 2.5/lib/ python2. 5/urllib2. pyc req.get_ method( ), req.get_selector(),
in do_open(self, http_class, req)
1078 try:
1079 h.request(
req.data, headers)
-> 1080 r = h.getresponse()
1081 except socket.error, err: # XXX what error?
1082 raise URLError(err)
/opt/local/ Library/ Frameworks/ Python. framework/ Versions/ 2.5/lib/ python2. 5/httplib. pyc self._method)
in getresponse(self)
926 method=
927
--> 928 response.begin()
929 assert response.will_close != _UNKNOWN
930 self.__state = _CS_IDLE
/opt/local/ Library/ Frameworks/ Python. framework/ Versions/ 2.5/lib/ python2. 5/httplib. pyc
in begin(self)
383 # read until we get a non-100 response
384 while True:
--> 385 version, status, reason = self._read_status()
386 if status != CONTINUE:
387 break
/opt/local/ Library/ Frameworks/ Python. framework/ Versions/ 2.5/lib/ python2. 5/httplib. pyc
in _read_status(self)
347 # Presumably, the server closed the connection before
348 # sending a valid response.
--> 349 raise BadStatusLine(line)
350 try:
351 [version, status, reason] = line.split(None, 2)
BadStatusLine:
All this were fired in a row.
Looks like urllib2 has trouble with networking here...
I'm hooked to a switch which is hooked to another switch shich has adsl
modem connected to it.
Jack