[mythtv-users] Python bindings and timezones

Keith Edmunds kae at midnighthax.com
Sun Oct 6 15:27:01 UTC 2013


0.26.1+fixes20130919

I have a script that transcodes recorded (radio) programs to mp3, then
deletes them. The delete part is failing on 0.26, and it seems to be
because DST (or, here, British Summer Time) isn't being handled correctly.

My transcode user job is passed the %STARTTIME% parameter (amongst
others), and in the past this worked:

--------------------------------------------------------------------------------
def main():
    channid = sys.argv[1]
    starttime = sys.argv[2]

    be = MythTV.MythBE()

    t.log(0, "channid=%s,starttime=%s" % (channid, starttime))
    rec = be.getRecording(channid, starttime)
--------------------------------------------------------------------------------

rec is always None because the %STARTTIME% parameter is local (DST) time,
but the database has UTC time.

This seems like a bug (it worked in earlier versions). I could fix it by
checking to see whether DST is in effect, but given that %STARTTIME% comes
from Myth, and the code extract above is using the Myth Python bindings, I
believe it should just work.

There are other posts that discuss Python and timezones, but all the fixes
referred to (eg,
http://code.mythtv.org/cgit/mythtv/commit/?id=4dd0bf8014bf8261c8ed347517ef8197ac7f942e)
are already in the version I'm running.

Am I missing something?

Thanks,
Keith
-- 
"You can't live a perfect day without doing something for someone 
who will never be able to repay you."


More information about the mythtv-users mailing list