Hello
I observed that in about 50% of cases freevo crashes directly after
start with the following error message:
INFO __init__(1072): preparing skin settings
INFO __init__(1072): preparing took 0.0331819057465 seconds
ERROR __init__(1072): Crash!
Traceback (most recent call last):
File "./freevo", line 269, in ?
MainMenu()
File
"/home/tanja/Programme/freevo-2.0//lib/python2.4/site-packages/freevo/ui/mainmenu.py",
line 147, in __init__
self.menuw = MenuWidget(menu)
File
"/home/tanja/Programme/freevo-2.0//lib/python2.4/site-packages/freevo/ui/application/menuw.py",
line 47, in __init__
Application.__init__(self, 'menu', 'menu', (CAPABILITY_TOGGLE,))
File
"/home/tanja/Programme/freevo-2.0//lib/python2.4/site-packages/freevo/ui/application/base.py",
line 73, in __init__
self.engine = gui.Application(name)
File
"/home/tanja/Programme/freevo-2.0//lib/python2.4/site-packages/freevo/ui/gui/compat.py",
line 135, in Application
return eval('_' + name.capitalize())()
File
"/home/tanja/Programme/freevo-2.0//lib/python2.4/site-packages/freevo/ui/gui/compat.py",
line 62, in __init__
self.tvengine = Handler('tv', tv)
File
"/home/tanja/Programme/freevo-2.0//lib/python2.4/site-packages/freevo/ui/gui/areas/handler.py",
line 102, in __init__
self.areas.append(eval('%sArea()' % a.capitalize()))
File "<string>", line 0, in ?
File
"/home/tanja/Programme/freevo-2.0//lib/python2.4/site-packages/freevo/ui/gui/areas/tvlisting_area.py",
line 93, in __init__
self.channels = kaa.epg.get_channels(sort=True)
File "/usr/lib/python2.4/site-packages/kaa/epg/__init__.py", line 74,
in get_channels
channels = guide.get_channels()[:]
TypeError: unsubscriptable object
In the other cases startup works without problems.
The exeption is occuring in the following code from kaa.epg.__init__.py:
def get_channels(sort=False):
"""
Return a list of all channels.
"""
if not guide.status == DISCONNECTED:
if sort:
channels = guide.get_channels()[:]
channels.sort(lambda a, b: cmp(a.name, b.name))
channels.sort(lambda a, b: cmp_channel(a, b))
return channels
return guide.get_channels()
return []
Everything went fine, if guide.status==DISCONNECTED at this stage of
freevo's booting process, then the call to get_channels returns just a
empty list, which seems to be OK.
If the guide.status is not DISCONNECTED, then the crash occures!
As a fast fix, I changed the code to catch the TypeError exception and
return an empty list instead. But I wonder why freevo is asking for a
channel list so early in its boot process, if it is also quite satisfied
with an empty list here. Another question is, why is the get_channels()
function crashing. It is also called later, when the user opens the
tvguide and then not crashs happen.
I guess there is more behind this...
Regards
Tanja
@Dischi: Sorry, I know you are very busy at the moment, but I send this
nevertheless now, because I do not want to forget it...
Index: epg/src/__init__.py
===================================================================
--- epg/src/__init__.py (Revision 2553)
+++ epg/src/__init__.py (Arbeitskopie)
@@ -71,11 +71,15 @@
"""
if not guide.status == DISCONNECTED:
if sort:
- channels = guide.get_channels()[:]
+ try:
+ channels = guide.get_channels()[:]
+ except TypeError:
+ log.warning('TypeError in get_channels')
+ return []
channels.sort(lambda a, b: cmp(a.name, b.name))
channels.sort(lambda a, b: cmp_channel(a, b))
return channels
- return guide.get_channels()
+ return guide.get_channels()[:]
return []
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-devel