New issue 144 by hemanth...@gmail.com: AttributeError: 'unicode' object has
no attribute 'get'
http://code.google.com/p/python-twitter/issues/detail?id=144
>>> api = twitter.Api(username='user', password='password')
>>> users = api.GetFriends()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "twitter.py", line 1794, in GetFriends
return [User.NewFromJsonDict(x) for x in data]
File "twitter.py", line 963, in NewFromJsonDict
return User(id=data.get('id', None),
AttributeError: 'unicode' object has no attribute 'get'
Password has special characters in it.
uname -a
Linux ubuntu 2.6.32-21-generic-pae #32-Ubuntu SMP Fri Apr 16 09:39:35 UTC
2010 i686 GNU/Linux
Version Details :
Python 2.6.5
python-twitter-0.6
Get similar error. Password has no special characters - so i get a str eror
rather than a unicode
Traceback (most recent call last):
File "twitterCA.py", line 18, in <module>
users = api.GetFriends()
File "/home/chris/Desktop/twitter.py", line 1820, in GetFriends
return [User.NewFromJsonDict(x) for x in data]
File "/home/chris/Desktop/twitter.py", line 963, in NewFromJsonDict
return User(id=data.get('id', None),
AttributeError: 'str' object has no attribute 'get'
I'm getting the same issue with no special characters in the password.
>>> api = twitter.Api(username='username',password='password')
>>> users = api.GetFriends()
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/home2/spyderfcs/webapps/dev/baselinecreations/ve/src/python-twitter/twitter.py",
line 1794, in GetFriends
return [User.NewFromJsonDict(x) for x in data]
File "/home2/spyderfcs/webapps/dev/baselinecreations/ve/src/python-twitter/twitter.py",
line 963, in NewFromJsonDict
return User(id=data.get('id', None),
The root cause for this turns out to be a Twitter change. The JSON data
returned for GetFriends used to only be a list, but now it appears other
data elements are returned.
I've tweaked how the NewFromJsonDict() method for User works so that it now
requests the 'users' item from the base JSON returned and then iterating
over that.
Comment #4 on issue 144 by bear42: AttributeError: 'unicode' object has no
attribute 'get'
http://code.google.com/p/python-twitter/issues/detail?id=144
change committed in revision 661a3f9475
"Except using search"...by searching for what? A space?
--To view this discussion on the web visit https://groups.google.com/d/msg/python-twitter/-/HmcpOcqyr34J.
You received this message because you are subscribed to the Google Groups "python-twitter" group.
To post to this group, send email to python-...@googlegroups.com.
To unsubscribe from this group, send email to python-twitte...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/python-twitter?hl=en.