[mythtv-users] Error Reading MythTV XML Status with Python

Ian Barton lists at manor-farm.org
Sat Nov 15 11:13:35 UTC 2008


I think that this is more of a python problem, than a Myth one. However, 
someone here might have an answer. I am reading the MythTV xml status 
from http://myserver:6544 and parsing it in python.

If I do it like this:

f =  urllib.urlopen("http://mythtv.banter.local:6544")
dom = minidom.parse(f)

I always get the following error:

Traceback (most recent call last):
   File "<stdin>", line 33, in <module>
   File "/usr/lib/python2.5/xml/dom/minidom.py", line 1915, in parse
     return expatbuilder.parse(file)
   File "/usr/lib/python2.5/xml/dom/expatbuilder.py", line 928, in parse
     result = builder.parseFile(file)
   File "/usr/lib/python2.5/xml/dom/expatbuilder.py", line 207, in parseFile
     parser.Parse(buffer, 0)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 4, 
column 33

However, if I save the file from urlopen to disk and then read it from disk:

dom = minidom.parse("mythtv.status.xml")

I get no errors.

Ian.


More information about the mythtv-users mailing list