Opened 6 years ago

Closed 6 years ago

#11768 closed Bug Report - Crash (Fixed)

tmdb3.py crash on download movie ID 116711 from tmdb

Reported by: mythtv@… Owned by: Raymond Wagner
Priority: minor Milestone: 0.26.2
Component: Contributed Scripts & Apps Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description (last modified by Raymond Wagner)

Not sure if this is an api issue but tmdb3.py crashes hard when retrieving details for the ID 116711 (epic). Seems the expected month format is not returned. See below:

/usr/share/mythtv/metadata/Movie/tmdb3.py -l en -a CA -D 116711
Traceback (most recent call last):
  File "/usr/share/mythtv/metadata/Movie/tmdb3.py", line 272, in <module>
    main()
  File "/usr/share/mythtv/metadata/Movie/tmdb3.py", line 266, in main
    buildSingle(args[0], opts)
  File "/usr/share/mythtv/metadata/Movie/tmdb3.py", line 88, in buildSingle
    if crew.profile: d['thumb'] = crew.profile.geturl()
  File "/usr/lib64/python2.7/site-packages/MythTV/tmdb3/util.py", line 143, in __get__
    self.poller.__get__(inst, owner)()
  File "/usr/lib64/python2.7/site-packages/MythTV/tmdb3/util.py", line 77, in __call__
    self.apply(req.readJSON())
  File "/usr/lib64/python2.7/site-packages/MythTV/tmdb3/util.py", line 86, in apply
    setattr(self.inst, v, data[k])
  File "/usr/lib64/python2.7/site-packages/MythTV/tmdb3/util.py", line 148, in __set__
    value = self.handler(value)
  File "/usr/lib64/python2.7/site-packages/MythTV/tmdb3/util.py", line 163, in <lambda>
    self.handler = lambda x: handler(x)
  File "/usr/lib64/python2.7/site-packages/MythTV/tmdb3/tmdb_api.py", line 81, in process_date
    return datetime.date(*[int(x) for x in datestr.split('-')])
TypeError: Required argument 'month' (pos 2) not found

Change History (6)

comment:1 Changed 6 years ago by dekarl@…

One of the movies authors, http://www.themoviedb.org/person/10295-james-v-hart , has a date of birth on file that contains a year only

that was not possible before, see https://www.themoviedb.org/talk/50e2badb19c2955b3214e4bd

comment:2 Changed 6 years ago by Raymond Wagner

Component: MythTV - MythmetadatalookupContributed Scripts & Apps
Description: modified (diff)
Milestone: 0.27unknown
Owner: set to Raymond Wagner
Priority: majorminor
Status: newaccepted

comment:3 Changed 6 years ago by Raymond Wagner

Status: acceptedinfoneeded

Are you running a recent version of MythTV? Both master and 0.26 were updated a month and a half ago to resolve this issue.

>>> Movie(116711).crew[3].dayofbirth
/usr/local/lib/python2.7/site-packages/tmdb3/tmdb_api.py:79: Warning: "1960" is not a supported date format. Please fix upstream data at http://www.themoviedb.org.
  return datetime.date(*[int(x) for x in datestr.split('-')])

comment:4 Changed 6 years ago by mythtv@…

I am running 0.27_alpha_186 (186 being the git number). I can rebuild the current 0.27_beta and try again. I provide more specific build information later.

comment:5 Changed 6 years ago by Raymond Wagner

Milestone: unknown0.27
Status: infoneededassigned

This code in the out-of-tree version fires a ValueError?, which is caught by the error handling and returns an empty string.

https://github.com/wagnerrp/pytmdb3/blob/master/tmdb3/tmdb_api.py#L79

The same exact code in-tree fires a TypeError?, which is not handled, and faults out the entire script.

http://code.mythtv.org/cgit/mythtv/tree/mythtv/bindings/python/tmdb3/tmdb3/tmdb_api.py#n79

I can't claim to understand why there is a difference in behavior for the same code, but if nothing else, I can just have it hook on both errors.

comment:6 Changed 6 years ago by Raymond Wagner

Milestone: 0.270.26.2
Resolution: Fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.