Opened 10 years ago

Closed 10 years ago

#7338 closed defect (fixed)

mirobridge segfaults with pubDate < 1900

Reported by: managementboy@… Owned by: sphery
Priority: minor Milestone: unknown
Component: Contributed Scripts & Apps Version: 0.22rc1
Severity: low Keywords:
Cc: Ticket locked: no

Description

Some Feeds/Channels? in Miro seem have "broken" pubDate fields, for example with years smaller than 1900. This leads to a crash of mirobridge when importing to MythTV. Maybe a check for this could be added to the script to make it more robust.

The error is:

Shutting down...                                                                                                                    
Traceback (most recent call last):                                                                                                  
  File "/usr/share/doc/mythtv-backend/contrib/imports/mirobridge/mirobridge.py", line 2785, in <module>                             
    main()                                                                                                                          
  File "/usr/share/doc/mythtv-backend/contrib/imports/mirobridge/mirobridge.py", line 2752, in main                                 
    if not updateMythRecorded(unwatched):                                                                                           
  File "/usr/share/doc/mythtv-backend/contrib/imports/mirobridge/mirobridge.py", line 1948, in updateMythRecorded                   
    records = createRecordedRecords(item)                                                                                           
  File "/usr/share/doc/mythtv-backend/contrib/imports/mirobridge/mirobridge.py", line 1463, in createRecordedRecords                
    tmp_recorded[u'originalairdate'] = item[u'releasedate'].strftime('%Y-%m-%d')                                                    
ValueError: year=1 is before 1900; the datetime strftime() methods require year >= 1900 

Thanks for the help!

Change History (3)

comment:1 Changed 10 years ago by managementboy@…

This seems to fix it...

if item[u'releasedate'] != None and item[u'releasedate'] > datetime.datetime(1900, 01, 01, 0, 00, 00):

comment:2 Changed 10 years ago by robertm

(In [22500]) Refs #7338. Prevent abort of Mirobridge if release date is invalid. Patch provided by Doug Vaughan.

comment:3 Changed 10 years ago by robertm

Resolution: fixed
Status: newclosed

(In [22501]) Closes #7338. Prevent abort of Mirobridge if release date is invalid. Patch provided by Doug Vaughan. (.22-fixes backport)

Note: See TracTickets for help on using tickets.