[mythtv-commits] Ticket #11447: Daylight Savings Time transition broken

MythTV noreply at mythtv.org
Fri Mar 8 01:54:35 UTC 2013


#11447: Daylight Savings Time transition broken
-----------------------------------------+------------------------
     Reporter:  Tom Grigg <tomegrigg@…>  |      Owner:  wagnerrp
         Type:  Bug Report - General     |     Status:  new
     Priority:  minor                    |  Milestone:  unknown
    Component:  Bindings - Python        |    Version:  0.26-fixes
     Severity:  medium                   |   Keywords:
Ticket locked:  0                        |
-----------------------------------------+------------------------
 The POSIX timezone implementation in the MythTV python bindings does not
 properly handle the transition to summer (daylight savings) time, which
 occurs here in the USA this coming weekend.

 This is caused by scanning the transition table using the local time
 entry, which for the transition to DST is actually one hour ahead of the
 time for which the transition is being looked up.

 A symptom of this issue is that attempting to convert a datetime instance
 from UTC to local time during the transition and the hour following will
 result in an incorrect result.  For example:
 {{{
 #!python
      starttime = datetime.duck('2013-03-10T10:30:00Z')
      print starttime.astimezone(datetime.localTZ())
 }}}
 will print
 {{{
 #!python
      2013-03-10 02:30:00-08:00
 }}}
 instead of
 {{{
 #!python
      2013-03-10 03:30:00-07:00
 }}}

 Attached is a testcase and a quick and dirty patch which fixes the issue.
 It may be more elegant to implement a fix as the zoneinfo tables are read
 rather than during transition search.

-- 
Ticket URL: <http://code.mythtv.org/trac/ticket/11447>
MythTV <http://code.mythtv.org/trac>
MythTV Media Center


More information about the mythtv-commits mailing list