LaurentCR / pylast

Automatically exported from code.google.com/p/pylast
Apache License 2.0
0 stars 0 forks source link

User.getFriends breaks when a user has many friends #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Please type example code that produces the issue:

User('cheap_mondays', API_KEY, API_SECRET, SESSION_KEY).getFriends()

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

I expect the list of friends of 'cheap_mondays', instead I get this:

Traceback (most recent call last):
  File "retrieveusers.py", line 53, in <module>
    User('cheap_mondays', API_KEY, API_SECRET, SESSION_KEY).getFriends()
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-
packages/pylast.py", line 2270, in getFriends
    doc = Request(self, 'user.getFriends', self.api_key, params).execute()
  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-
packages/pylast.py", line 304, in execute
    doc = minidom.parse(response)
  File 
"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xml/dom/minidom
.py", 
line 1918, in parse
    return expatbuilder.parse(file)
  File 
"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xml/dom/expatbu
ilder.py
", line 928, in parse
    result = builder.parseFile(file)
  File 
"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xml/dom/expatbu
ilder.py
", line 211, in parseFile
    parser.Parse("", True)
xml.parsers.expat.ExpatError: no element found: line 18585, column 73

What version of pyLast is this?

pyLast-0.2b12.tar.gz

Please provide any additional information below.

This happens because the user cheap_mondays has almost 3,000 friends!
http://www.last.fm/user/cheap_mondays/friends
I guess in this case, the function should not crash, but return something or 
wait.

Original issue reported on code.google.com by claud...@gmail.com on 16 Oct 2008 at 2:14

GoogleCodeExporter commented 9 years ago
That's a problem with the webservice, i wrote about it in the last.fm group. I 
can do
nothing further it except recommending always using a limit value with 
User.getFriends.

Thanks for taking the time to report this.

Original comment by amr.hassan on 16 Oct 2008 at 3:19