Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#11093 closed Bug Report - General (fixed)

Python Bindings IndexError

Reported by: superm1@… Owned by: Raymond Wagner
Priority: minor Milestone: 0.26
Component: Bindings - Python Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no


This was submitted to the mythbuntu bug tracker at This should be a very recent build (9/17, git snapshot 0a56d7f) Details below:

version is 2:0.26.0~master.20120917.0a56d7f-0ubuntu0mythbuntu2

For the last week or so, I've realized that I cannot download metadata. I debugged further and the mythtv python libraries are throwing an IndexError?. The full error is

root@mythtv:~/Data# mythwikiscripts
Traceback (most recent call last):
  File "/usr/bin/mythwikiscripts", line 3, in <module>
    from MythTV.wikiscripts import *
  File "/usr/lib/python2.7/dist-packages/MythTV/", line 41, in <module>
    from dataheap import *
  File "/usr/lib/python2.7/dist-packages/MythTV/", line 583, in <module>
  File "/usr/lib/python2.7/dist-packages/MythTV/", line 589, in Job
    _defaults = {'id':None, 'inserttime',
  File "/usr/lib/python2.7/dist-packages/MythTV/utility/", line 237, in now
    obj = super(datetime, cls).now(tz)
  File "/usr/lib/python2.7/dist-packages/MythTV/utility/", line 55, in utcoffset
    return timedelta(0, self._get_transition(dt).offset)
  File "/usr/lib/python2.7/dist-packages/MythTV/utility/", line 38, in _get_transition
    if dt < self._transitions[index].local[0:5]:
IndexError: tuple index out of range(

I'm not sure how to fix this. I've removed all the python scripts and reinstalled. no change. i've diffed the python scripts ( and with the mythth git version. They are identical.

I've added the timezone data to mysql and verified that it works by logging into mysql and doing something like

SELECT CONVERT_TZ('2012-06-07 12:00:00', 'GMT', 'America/New_York');

the correct response (shown below) is returned

| CONVERT_TZ('2012-06-07 12:00:00', 'GMT', 'America/New_York') |
| 2012-06-07 08:00:00 |

What can I do to fix this?

my mythtv box is running the latest precise packages.

It might be a mythbuntu and/or ubuntu precise issue as nobody is reporting this error (which affects every python script) on the mythtv mailing lists and bug repository.



Change History (5)

comment:1 Changed 9 years ago by Raymond Wagner <rwagner@…>

In a403c19d92c0e8ba7c8c2cce9d8b7d26195fbb7d/mythtv:

Reorder zoneinfo processing to ensure all transitions are handled.

This reorders the transition index lookup to ensure that all timestamps
are referenced, or an error is thrown, rather than silently erroring at
some later point.

Refs #11093

comment:2 Changed 9 years ago by Raymond Wagner

Could I get a copy of whatever zoneinfo file was installed to /etc/localtime?

comment:3 Changed 9 years ago by Raymond Wagner <rwagner@…>

Resolution: fixed
Status: newclosed

In 91c3e66af5a08a06685fdda136aa52ffb4eb4a8a/mythtv:

Add better handling of simple zoneinfo files.

This adds support for timezones with no defined transitions (UTC), and
ones that define a single transition for a simple offset. This also
improves the normal search function to properly handle dates that fall
to the future of the last transition point, and thus cannot be
bracketed. Dates in the past before the first transition point give a
more descriptive error.

Fixes #11093

comment:4 Changed 9 years ago by Raymond Wagner

Milestone: unknown0.26

comment:5 Changed 9 years ago by superm1@…

The reporter confirmed that your fixes resolved the problem. Thanks.

Note: See TracTickets for help on using tickets.