[mythtvnz] Python errors in tv_grab_nz-py so mythfilldatabase fails
Robin Gilks
g8ecj at gilks.org
Tue Jul 5 02:36:00 BST 2011
> I'm running the same - tv_grab_nz-py-0.2.6 and epgsnoop-0.84
>
> The problem appears to be an update to something in my python subsystem
> which has occurred in the last couple of weeks. It may be an environment
> issue that the latest and greatest python-2.7 now requires that has always
> been missing - character set or something. It certainly seems to be
> accented characters and symbols that it barfs on.
Oh what a hack....
I've solved it as follows:
--- tv_grab_nz-py.orig 2011-07-04 07:29:17.000000000 +1200
+++ tv_grab_nz-py 2011-07-05 13:32:53.000000000 +1200
@@ -258,7 +258,8 @@
sys.exit(2)
log.info('Parsing listings...')
-doc = ElementTree.parse(StringIO(text)).getroot()
+parser = ElementTree.XMLParser(encoding="ISO-8859-1")
+doc = ElementTree.parse(StringIO(text), parser=parser).getroot()
newdoc = ElementTree.Element('tv', doc.attrib)
since it appears that the data coming from the 'other channels' is encoded
in ISO-8859-1 and one of the changes to ElementTree in python2.7 is that a
parser can be defined by the user. Looks like the default one doesn't cut
the mustard any more.
I may have the wrong encoding standard but its now working for me :)
--
Robin Gilks
More information about the mythtvnz
mailing list