Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


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

darshanhegde opened this Issue · 2 comments

2 participants


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 "", line 3049, in UsersLookup
    return [User.NewFromJsonDict(u) for u in data]
  File "", 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.

@bear bear was assigned

Definitely a bug - thanks for the report.


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.


@bear bear closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.