IMDbDataAccessError: timed out

Issue #43 closed
Thomas Dietrich
created an issue

Hey there,

when using imdbpy, I randomly get the following exception, causing my program to exit. This behavior is new and I'm not sure how to tackle it. Is this something imdbpy can handle or do I have to catch this myself?

Testet with IMDbPY-5.1dev_r0_20150217

2015-02-17 17:39:07,763 CRITICAL [imdbpy] /usr/local/lib/python2.7/dist-packages/IMDbPY-5.1dev_r0_20150217-py2.7-linux-x86_64.egg/imdb/ IMDbDataAccessError exception raised; args: ({'exception type': 'IOError', 'url': '', 'errcode': 'socket error', 'proxy': '', 'original exception': IOError('socket error', timeout('timed out',)), 'errmsg': 'timed out'},); kwds: {}
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/IMDbPY-5.1dev_r0_20150217-py2.7-linux-x86_64.egg/imdb/parser/http/", line 202, in retrieve_unicode
    uopener =
  File "/usr/lib/python2.7/", line 208, in open
    return getattr(self, name)(url)
  File "/usr/lib/python2.7/", line 345, in open_http
  File "/usr/lib/python2.7/", line 969, in endheaders
  File "/usr/lib/python2.7/", line 829, in _send_output
  File "/usr/lib/python2.7/", line 791, in send
  File "/usr/lib/python2.7/", line 772, in connect
    self.timeout, self.source_address)
  File "/usr/lib/python2.7/", line 571, in create_connection
    raise err
IOError: [Errno socket error] timed out
2015-02-17 17:39:07,767 CRITICAL [imdbpy] /usr/local/lib/python2.7/dist-packages/IMDbPY-5.1dev_r0_20150217-py2.7-linux-x86_64.egg/imdb/ caught an exception retrieving or parsing "main" info set for mopID "0443649" (accessSystem: http)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/IMDbPY-5.1dev_r0_20150217-py2.7-linux-x86_64.egg/imdb/", line 772, in update
    ret = method(mopID)
  File "/usr/local/lib/python2.7/dist-packages/IMDbPY-5.1dev_r0_20150217-py2.7-linux-x86_64.egg/imdb/parser/http/", line 506, in get_movie_main
    cont = self._retrieve(self.urls['movie_main'] % movieID + 'combined')
  File "/usr/local/lib/python2.7/dist-packages/IMDbPY-5.1dev_r0_20150217-py2.7-linux-x86_64.egg/imdb/parser/http/", line 453, in _retrieve
    ret = self.urlOpener.retrieve_unicode(url, size=size)
  File "/usr/local/lib/python2.7/dist-packages/IMDbPY-5.1dev_r0_20150217-py2.7-linux-x86_64.egg/imdb/parser/http/", line 236, in retrieve_unicode
    'original exception': e})
IMDbDataAccessError: {'exception type': 'IOError', 'url': '', 'errcode': 'socket error', 'proxy': '', 'original exception': IOError('socket error', timeout('timed out',)), 'errmsg': 'timed out'}

Comments (4)

  1. Thomas Dietrich reporter

    my workaround:

        for _ in range(5):
                movie = ia.get_movie(id)
            except IMDbDataAccessError:
                print "IMDbDataAccessError"
        if not ('movie' in locals() or 'movie' in globals()):
            print "SKIP - fix this!"
            return None
  2. Log in to comment