Tomáš Hnyk | 21 Mar 2012 22:31
Picon

timing out

Hello all,
so let's say I am trying to get movie's info:
movie = imdb.IMDb().get_movie('FilmID')
but it times out - i.e. something goes wrong and the movie's info is not
retrieved. Ideally, I would like to do something like:
try:
      movie = imdb.IMDb().get_movie('FilmID')
except imdb.IMDbDataAccessError:
      # tell me it times out and do something about it
But it seems imdb.IMDb().get_movie() does not give exceptions when it
times out. (It sometimes is not succesful in retrieving movies info but is
suspiciously silent about it).

Am I doing something wrong?
Regards,
Tomas

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
Davide Alberani | 22 Mar 2012 08:46
Picon
Gravatar

Re: timing out

On Wed, Mar 21, 2012 at 22:31, Tomáš Hnyk <tomashnyk <at> gmail.com> wrote:
>
> But it seems imdb.IMDb().get_movie() does not give exceptions when it
> times out. (It sometimes is not succesful in retrieving movies info but is
> suspiciously silent about it).
>
> Am I doing something wrong?

No, you're right.
It's done to gracefully handle the (many) problems that can arise parsing
information... in the general case, it's better to go on and live without
some information.

Anyway, it's easy to add a parameter of IMDb() that can be used to
re-raise the caught exception, if one wants it.

I'll do it in the weekend, and I'll let you know.

Thanks for the report!

--

-- 
Davide Alberani <davide.alberani <at> gmail.com>  [PGP KeyID: 0x465BFD47]
http://www.mimante.net/

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Imdbpy-help mailing list
(Continue reading)


Gmane