[mythtv-users] find_orphans.py broken on 32 bit x86?

Jay Harbeston (ISeePeople) jharbestonus at gmail.com
Wed Oct 31 20:43:29 UTC 2018


Looks like the date is getting interpreted as being in the future?

Maybe time zone settings are incorrect..

Just a theory

> On Oct 31, 2018, at 4:38 PM, Tom Dexter <digitalaudiorock at gmail.com> wrote:
> 
> On 10/31/18, Will Dormann <wdormann at gmail.com> wrote:
>> On 10/31/18 2:56 PM, Tom Dexter wrote:
>>>    obj = super(datetime, cls).fromtimestamp(float(timestamp), tz)
>>> ValueError: timestamp out of range for platform time_t
>>> 
>>> I'm pretty sure that the limit for that time_t may be 2147483647 on
>>> x86 and 67768036191676795 on 64 bit systems(?). Has anyone here ever
>>> used that option on a 32 bit system?
>> 
>> 
>> I don't suspect that this is a 32-bit vs. 64-bit thing.   A 32-bit
>> system can handle any timestamp that may be associated with a recording.
>>  It's possible that you have a recording with an invalid timestamp.
>> 
>> I'd replace line 129:
>> 
>>                    rec.delete(True, True)
>> 
>> With:
>>                    try:
>>                        rec.delete(True, True)
>>                    except ValueError:
>>                        print('Error deleting %s' % rec)
>> 
>> And perhaps report back here if there's a single (or few) problematic
>> recording, of if it's for all of them.
>> 
>> 
>> -WD
> 
> I agree that it should be able to handle an epoch value as a
> timestamp, but I have a feeling it's doing something else there that
> is in fact causing a problem. The error I reported above was done with
> a brand new recording where I moved the video file as a test. No
> question it had perfectly valid times. I just tried another:
> 
> ./find_orphans.py
> Recordings with missing files
>  mythback: Judge Judy - Random Vandalism or Hilary Clinton Attack?
>       1021_20181031203000.ts
> 
>           Count:           1
> Orphaned snapshots
>  mythback: /video/recordings/1021_20181031203000.ts.png
>                        1.7MB
> 
>           Total:       1.7MB
> Please select from the following
> 1. Delete orphaned recording entries
> 2. Delete orphaned snapshots
> 3. Refresh list
>> 1
> The following recordings will be deleted
>  mythback: Judge Judy - Random Vandalism or Hilary Clinton Attack?
>       1021_20181031203000.ts
> 
>           Count:           1
> Are you sure you want to continue?
>> yes
> Traceback (most recent call last):
>  File "./find_orphans.py", line 230, in <module>
>    main()
>  File "./find_orphans.py", line 214, in main
>    opt[1](opt[2])
>  File "./find_orphans.py", line 129, in delete_recs
>    rec.delete(True, True)
>  File "/usr/lib/python2.7/site-packages/MythTV/dataheap.py", line
> 375, in delete
>    return self.getProgram().delete(force, rerecord)
>  File "/usr/lib/python2.7/site-packages/MythTV/dataheap.py", line
> 387, in getProgram
>    return Program.fromRecorded(self)
>  File "/usr/lib/python2.7/site-packages/MythTV/mythproto.py", line
> 946, in fromRecorded
>    return be.getRecording(rec.chanid, rec.starttime)
>  File "/usr/lib/python2.7/site-packages/MythTV/mythproto.py", line
> 647, in getRecording
>    return Program(res[1:], db=self.db)
>  File "/usr/lib/python2.7/site-packages/MythTV/mythproto.py", line
> 875, in __init__
>    DictData.__init__(self, raw)
>  File "/usr/lib/python2.7/site-packages/MythTV/altdict.py", line 148,
> in __init__
>    data = self._process(data)
>  File "/usr/lib/python2.7/site-packages/MythTV/altdict.py", line 164,
> in _process
>    data[i] = self._trans[self._field_type[i]](v)
>  File "/usr/lib/python2.7/site-packages/MythTV/altdict.py", line 104,
> in <lambda>
>    lambda x: datetime.fromtimestamp(x, datetime.UTCTZ())\
>  File "/usr/lib/python2.7/site-packages/MythTV/utility/dt.py", line
> 304, in fromtimestamp
>    obj = super(datetime, cls).fromtimestamp(float(timestamp), tz)
> ValueError: timestamp out of range for platform time_t
> 
> Here's the record in the recorded table...nothing wrong there:
> 
> mysql> select * from recorded where title='judge judy'\G
> *************************** 1. row ***************************
>         chanid: 1021
>      starttime: 2018-10-31 20:30:00
>        endtime: 2018-10-31 20:31:00
>          title: Judge Judy
>       subtitle: Random Vandalism or Hilary Clinton Attack?
>    description: A stranger allegedly keys a six-foot scratch on the
> side of a car that has a Clinton bumper sticker on it.
>         season: 0
>        episode: 0
>       category: Reality
>       hostname: mythback
>       bookmark: 0
>        editing: 0
>        cutlist: 0
>     autoexpire: 1
>    commflagged: 0
>       recgroup: Default
>       recordid: 8308
>       seriesid: EP00188710
>      programid: EP001887106287
>        inetref:
>   lastmodified: 2018-10-31 16:30:00
>       filesize: 35206384
>          stars: 0
> previouslyshown: 0
> originalairdate: 2018-10-31
>       preserve: 0
>         findid: 0
>  deletepending: 0
>     transcoder: 0
>    timestretch: 1
>    recpriority: 0
>       basename: 1021_20181031203000.ts
>      progstart: 2018-10-31 20:00:00
>        progend: 2018-10-31 20:30:00
>      playgroup: Default
>        profile: Default
>      duplicate: 1
>     transcoded: 0
>        watched: 0
>   storagegroup: Default
> bookmarkupdate: 0000-00-00 00:00:00
>     recgroupid: 1
>     recordedid: 5582
>      inputname: HDHR 1
> 1 row in set (0.01 sec)
> 
> Tom
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-users
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org



More information about the mythtv-users mailing list