[mythtv-users] orphans

Stephen Worthington stephen_agent at jsw.gen.nz
Mon Sep 28 13:55:41 UTC 2020


On Mon, 28 Sep 2020 07:31:30 -0400, you wrote:

>I'm getting an error when I run "./find_orphans.pl"  :
>
>the following recordings will be deleted
>  trieli: Council of Dads - The Sixth Stage
>  1321_20200514235900.ts
>  trieli: Council of Dads - Heart Medicine
>   1321_20200604235900.ts
>  trieli: Fruitvale Station
>  1002_20200706025900.ts
>  trieli: NFL Football - Carolina Panthers at Tampa Bay Buccaneers
>   1171_20200920165900.ts
>  trieli: The Code
>   1503_20200711235900.ts
>  trieli: The Good, the Bad and the Ugly
>   1322_20200607205900.ts
>
>      Count:           6
>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/python3/dist-packages/MythTV/dataheap.py", line 377, in
>delete
>    return self.getProgram().delete(force, rerecord)
>  File "/usr/lib/python3/dist-packages/MythTV/mythproto.py", line 972, in
>delete
>    res = int(be.deleteRecording(self, force=force))
>  File "/usr/lib/python3/dist-packages/MythTV/mythproto.py", line 668, in
>deleteRecording
>    [command,program.toString()]))
>  File "/usr/lib/python3/dist-packages/MythTV/mythproto.py", line 962, in
>toString
>    return BACKEND_SEP.join(self._deprocess())
>  File "/usr/lib/python3/dist-packages/MythTV/altdict.py", line 178, in
>_deprocess
>    data[i] = self._inv_trans[self._field_type[i]](v)
>  File "/usr/lib/python3/dist-packages/MythTV/altdict.py", line 113, in
><lambda>
>    lambda x: str(int(x.timestamp())),
>  File "/usr/lib/python3/dist-packages/MythTV/utility/dt.py", line 481, in
>timestamp
>    return ((utc_naive - utc_epoch).total_seconds())
>TypeError: can't subtract offset-naive and offset-aware datetime
>
>Do I need to "touch" these files then re-try?
>
>If so, would that be "sudo touch
>/drives/storage1/mythtv/recordings/1321_20200514235900.ts" and so on for
>each?
>
>TIA  Daryl

My guess is that you have found a bug resulting from the MythTV Python
bindings having recently been converted from Python 2 to Python 3.  I
think you will be the first person to get them to execute that
particular line of code after the conversion, and it does not work in
Python 3.  This is one of the hazards of doing Python 2 to Python 3
conversions - you have to be able to get the code to run all parts of
itself somehow, otherwise you do not find things like this.  It is an
incredibly difficult task to ensure that you have managed to get every
line of code to run, and even more difficult to ensure that you have
tested with every possible input value.

I have had a quick look at the code for "def timestamp" in dt.py where
this happens and it looks like the author has done the right things to
make both the utc_naive and utc_epoch variables into naive datetime
variables, so I am not sure why you are getting this error.  You
should probably file a bug report.  Note that bug reports now need to
be done on the github page instead of via Trac:

https://github.com/MythTV/mythtv/issues


More information about the mythtv-users mailing list