-
Notifications
You must be signed in to change notification settings - Fork 36
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
NoneType is not iterable #29
Comments
For some reason, the API is returning "null"s in the list of results. I'll have to pass this upstream to see what's going on. |
It seems these are movies that have been deleted, but haven't been completely flushed out of the API servers. They should be getting server side, but currently aren't. |
This temporarily resolves an issue where the TheMovieDb server returns nulls in searches when a movie has been deleted but not yet flushed out of the cache. This prevents the error internally, but does not attempt to re-order to remove the nulls, so is merely passing the issue onto the application using this library. Refs #29
I have updated the changes, same issue |
It resolves the issue locally, but as the commit message mentioned, it's not a proper fix. It just passes the null entries on to you to deal with. |
Sorry I didn't notice that, I have added some checking code and its all working fine again. Thanks for the help. |
Hi,
I am using PyTMDB3 and for the most part successfully, although I have 1 problem. I have the following code:
It goes through my movies and prints out the movie name found on tmdb. It works although there are 5 movies in which it doesnt work and I get an error and I cant figure out why.
The movies are Madagascar, Robin Hood, The Grey, The Watch and Zombieland. I can see that they are all on tmdb so am not sure why it isnt finding them.
The error is:
Traceback (most recent call last):
File "scan.py", line 14, in
res = searchMovie(fname)
File "/usr/local/lib/python2.7/dist-packages/tmdb3/tmdb_api.py", line 121, in searchMovie
return MovieSearchResult(Request('search/movie', **kwargs), locale=locale)
File "/usr/local/lib/python2.7/dist-packages/tmdb3/tmdb_api.py", line 148, in init lambda x: Movie(raw=x, locale=locale))
File "/usr/local/lib/python2.7/dist-packages/tmdb3/pager.py", line 101, in init super(PagedRequest, self).init(self._getpage(1), 20)
File "/usr/local/lib/python2.7/dist-packages/tmdb3/pager.py", line 56, in __init__self._data = list(iterable)
File "/usr/local/lib/python2.7/dist-packages/tmdb3/pager.py", line 108, in _ge tpageyield self._handler(item)
File "/usr/local/lib/python2.7/dist-packages/tmdb3/tmdb_api.py", line 148, in lambda x: Movie(raw=x, locale=locale))
File "/usr/local/lib/python2.7/dist-packages/tmdb3/util.py", line 350, in __call__obj._populate.apply(kwargs['raw'], False)
File "/usr/local/lib/python2.7/dist-packages/tmdb3/util.py", line 83, in apply if (k in
TypeError: argument of type 'NoneType' is not iterable
Thanks for any help.
Jay
The text was updated successfully, but these errors were encountered: