[mythtv-users] Python bindings and timezones

John Pilkington J.Pilk at tesco.net
Sun Oct 6 15:42:05 UTC 2013


On 06/10/13 16:27, Keith Edmunds wrote:
> 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 might get a hint from

http://code.mythtv.org/trac/attachment/ticket/11758/mythburn.patch

and the later patch on that ticket.

John P


More information about the mythtv-users mailing list