process_date fails if date is not formatted as YYYY-MM-DD #17

pnordhus opened this Issue Jul 2, 2012 · 2 comments


None yet

2 participants


The day of birth is not necessarily formatted as "YYYY-MM-DD"., for instance, contains only the year which causes process_date() to fail.

Python 2.7.3rc2 (default, Apr 22 2012, 22:30:17) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tmdb3
>>> tmdb3.set_key('7243d57358963cb7388deb6d1b0f50f5')
>>> person = tmdb3.Person(10295)
>>> print
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "tmdb3/", line 143, in __get__
    self.poller.__get__(inst, owner)()
  File "tmdb3/", line 77, in __call__
  File "tmdb3/", line 86, in apply
    setattr(self.inst, v, data[k])
  File "tmdb3/", line 148, in __set__
    value = self.handler(value)
  File "tmdb3/", line 163, in <lambda>
    self.handler = lambda x: handler(x)
  File "tmdb3/", line 67, in process_date
    return*[int(x) for x in datestr.split('-')])
TypeError: Required argument 'month' (pos 2) not found
@wagnerrp wagnerrp was assigned Jul 2, 2012

I'll add some code that will make this ignore the problem and allow access to the rest of the data, however upstream decision from Travis Bell is that this is an example of bad data. Proper solution is to correct the data on TMDb itself.


fc8e6d1 turns these errors into warnings, and allows the rest of the query to be processed and return data to the user.

@wagnerrp wagnerrp closed this Jul 2, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment