hi

I recently upgraded to the latest freevo 1.7.3 , using debian packages
at geode.info , and that exact bug started biting me immediatly. I saw
that bug each time I would try to add a favorite : recordserver would
crahs , with that exact stracktrace as in the original post, and the
record_schedule.xml file would be damaged.

The problem AFAIK is that marmalade.py in 1.7.3 does not handle 'bool'
types. But this was added in recent python twisted code. So I
backported the enhancement, and now it works as a charm (and my freevo
box is aain running to the pleasure of the whole family :-).

I prepared a patch. See attachment.

BTW: since s**t happens... what about saving record_schedule.xml in a
file record_schedule.xml.bak each time the recordserver is started,
and then restoring it if it crashes? Or, better yet, why not writing
to record_schedule.xml.new and then move it atomically to
record_schedule.xml only if it is OK ?

a.
--- /usr/lib/python2.4/site-packages/freevo/util/marmalade.py.orig	2007-11-06 09:32:03.000000000 +0100
+++ /usr/lib/python2.4/site-packages/freevo/util/marmalade.py	2007-11-06 21:44:12.000000000 +0100
@@ -163,6 +163,12 @@
             retval = float(node.getAttribute("value"))
         elif node.tagName == "longint":
             retval = long(node.getAttribute("value"))
+        elif node.tagName == "bool":
+            retval = int(node.getAttribute("value"))
+            if retval:
+                retval = True
+            else:
+                retval = False
         elif node.tagName == "module":
             retval = namedModule(str(node.getAttribute("name")))
         elif node.tagName == "class":
@@ -318,6 +324,9 @@
             # so that the object will show up where it's referenced first NOT
             # by a method.
             node.appendChild(self.jellyToNode(obj.im_self))
+        elif hasattr(types, 'BooleanType') and objType is types.BooleanType:
+            node = self.document.createElement("bool")
+            node.setAttribute("value", str(int(obj)))
         elif objType is types.ModuleType:
             node = self.document.createElement("module")
             node.setAttribute("name", obj.__name__)
@@ -383,8 +392,10 @@
                 else:
                     if hasattr(obj, "__getstate__"):
                         state = obj.__getstate__()
-                    else:
+                    elif hasattr(obj, "__dict__"):
                         state = obj.__dict__
+                    else:
+                        raise "Unsupported type: %s %s" % (objType.__name__,repr(obj))
                     n = self.jellyToNode(state)
                     node.appendChild(n)
             else:
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Freevo-devel mailing list
Freevo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to