<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-text-flowed" style="font-family: -moz-fixed;
font-size: 14px;" lang="x-western">On Wed, Dec 18, 2013 at 9:31
PM, Andrew Taylor <aretaylor at gmail.com> wrote:
<br>
> Hi Steve
<br>
>
<br>
> I gave it a go... but no luck...
<br>
> Traceback (most recent call last):
<br>
> File "./tv_grab_nz-py", line 227, in <module>
<br>
> use = raw_input('Use channel %s (%s)? [y/N]' %
(channel[1], channel[0]))
<br>
> UnicodeEncodeError: 'ascii' codec can't encode character
u'\u0101' in
<br>
> position 13: ordinal not in range(128)
<br>
<br>
Hi,
<br>
<br>
I had this problem when I set this up last weekend. The error is
caused by non-ascii characters being written to the terminal. I
worked around it by changing the code to assume 'y' for all
channels and then edited the output file by hand, but that's not
very friendly so here's a better, but not probably not ideal,
solution:
<br>
<br>
Change the line (no 227) in your file that looks like this:
<br>
<br>
use = raw_input('Use channel %s (%s)? [y/N]' % (channel[1],
channel[0]))
<br>
<br>
to:
<br>
<br>
use = raw_input('Use channel %s (%s)? [y/N]' %
(channel[1].encode('ascii', 'ignore'), channel[0]))
<br>
<br>
This will fix the problem by not writing any non ascii characters
to the terminal. This means, from memory, you'll see "Use channel
Mori Television (maori-tv.feeviewtv.nz)? [y/N]" but the correct
values will be written to the file.
<br>
<br>
Hope it works for you.
<br>
<br>
</div>
</body>
</html>