Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Api.UserLookUp() throws attribute error when corresponding screen_name is not found #4

Closed
darshanhegde opened this issue Oct 18, 2012 · 2 comments
Assignees

Comments

@darshanhegde
Copy link

I'm trying to do user-look up by screen_name, when I use a screen name that is not registered in twitter it throws attribute error. example trial goes below:

users = api.UsersLookup(screen_name=["dude_whats_up_is_your_name"])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "twitter.py", line 3049, in UsersLookup
    return [User.NewFromJsonDict(u) for u in data]
  File "twitter.py", line 1340, in NewFromJsonDict
    return User(id=data.get('id', None),
AttributeError: 'unicode' object has no attribute 'get'

I'm not sure if this is a design decision or a issue, please close it if it's done deliberately, otherwise I think it helps.

@ghost ghost assigned bear Nov 5, 2012
@bear
Copy link
Owner

bear commented Nov 5, 2012

Definitely a bug - thanks for the report.

@bear
Copy link
Owner

bear commented Nov 5, 2012

added a small bit of error handling for the odd way twitter returns an error if the only (or all) of the requested users are not found.

286369e

@bear bear closed this as completed Nov 5, 2012
bear pushed a commit that referenced this issue Aug 29, 2013
pythonpro pushed a commit to pythonpro/python-twitter that referenced this issue Jan 11, 2016
Api.UserLookUp() throws attribute error when corresponding screen_name is not found

bear/python-twitter#5
Merge pull request #5 from thefinn93/master
Setup.py crashes because the README file is now named README.md

Update .gitignore to add the PyCharm data directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants