[mythtvnz] Bad BBCWorld data

Stephen Worthington stephen_agent at jsw.gen.nz
Wed Apr 11 16:36:06 BST 2012


For the last couple of days, my Sky EPG grabbing has been failing in
xmltv-proc-nz with this error:

Traceback (most recent call last):
  File "/usr/local/bin/xmltv-proc-nz", line 552, in <module>
    BBCWorldOnTV1('tv1.freeviewnz.tv'),
  File "/usr/local/bin/xmltv-proc-nz", line 87, in __init__
    for line in reader:
_csv.Error: new-line character seen in unquoted field - do you need to
open the file in universal-newline mode?

(Note: The line numbers are for my version of xmltv-proc-nz with added
debug code)

I tracked down the problem to some extra carriage return characters
that are in the listings data downloaded from the BBCWorld web site at
the moment.  The fix I came up with was to delete all carriage returns
by adding this line:

  data = data.translate(None, '\r')

just above the line

  reader = csv.reader(data.split('\n'))

in class BBCWorldOnTV1.

I am not very experienced with Python, so I have no idea if that is a
good way to remove the carriage returns, but it seems to be working
for me.



More information about the mythtvnz mailing list