[mythtvnz] Python errors in tv_grab_nz-py so mythfilldatabase fails
Ross Williamson
ross at inertia.net.nz
Tue Aug 9 02:30:20 BST 2011
>> 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....
For what it's worth, I have just encountered the same issue.
This weekend I moved epgsnoop to a new machine as the old machine was being retired. The new machine is running Ubuntu 11.04 and defaults to Python 2.7. The listings that the epgsnoop+xmltv-proc-nz combo were outputting had characters in there that tv_grab_nz-py was barfing on.
I fixed the issue, not in tv_grab_nz-py, but by forcing epgsnoop+xmltv-proc-nz to use Python 2.6 (changed shebang line). There are a number of people using my listings so I didn't want to have to update tv_grab_nz-py on all of them. This procedure has worked (although obviously a short term solution) so no modifications to clients were necessary.
If it helps anyone, it would appear that xmltv-proc-nz was outputting this while running under Python 2.7:
Traceback (most recent call last):
File "/usr/local/bin/xmltv-proc-nz", line 572, in <module>
ElementTree.dump(tree)
File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1159, in dump
elem.write(sys.stdout)
File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 815, in write
serialize(write, self._root, encoding, qnames, namespaces)
File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 934, in _serialize_xml
_serialize_xml(write, e, encoding, qnames, None)
File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 934, in _serialize_xml
_serialize_xml(write, e, encoding, qnames, None)
File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 932, in _serialize_xml
write(_escape_cdata(text, encoding))
File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1068, in _escape_cdata
return text.encode(encoding, "xmlcharrefreplace")
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 8: ordinal not in range(128)
This does not appear when running under Python 2.6. I did not try only running xmltv-proc-nz under 2.6 (ie without epgsnoop) so maybe that is all that is necessary but I don't really have time to check this scenario out right now.
Ross
More information about the mythtvnz
mailing list