adibaewa / pylast

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

User.get_friends limit parameter #5

Closed GoogleCodeExporter closed 9 years ago

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

User(user, API_KEY, API_SECRET, SESSION_KEY).getFriends(limit=5)

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

The expected output is a list of 5 friends. Instead, I get this:

Traceback (most recent call last):
  File "retrieveusers.py", line 86, in <module>
    user_friends = get_friends(user)
  File "retrieveusers.py", line 59, in get_friends
    for friend in User(user, API_KEY, API_SECRET, SESSION_KEY).getFriends(limit=5):
  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 289, in execute
    data.append('='.join((name, urllib.quote_plus(self.params[name].encode('utf-8')))))
AttributeError: 'int' object has no attribute 'encode'

What version of pyLast is this?

Please provide any additional information below.

The problem is that the limit parameter has to be passed as a string, for 
instance limit='5' works, 
while limit=5 as an integer does not work. I guess this should be fixed, or at 
least documented

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

GoogleCodeExporter commented 9 years ago
Fixed in 0.2b13.

Thanks for taking the time to report this.

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