UnicodeDecodeError when reading dictionary words file with simple Python script
<p>First time doing Python in a while, and I'm having trouble doing a simple scan of a file when I run the following script with Python 3.0.1,</p>

<pre><code>with open("/usr/share/dict/words", 'r') as f:
   for line in f:
       pass
</code></pre>

<p>I get this exception:</p>

<pre><code>Traceback (most recent call last):
  File "/home/matt/install/test.py", line 2, in &lt;module&gt;
    for line in f:
  File "/home/matt/install/root/lib/python3.0/io.py", line 1744, in __next__
    line = self.readline()
  File "/home/matt/install/root/lib/python3.0/io.py", line 1817, in readline
    while self._read_chunk():
  File "/home/matt/install/root/lib/python3.0/io.py", line 1565, in _read_chunk
    self._set_decoded_chars(self._decoder.decode(input_chunk, eof))
  File "/home/matt/install/root/lib/python3.0/io.py", line 1299, in decode
    output = self.decoder.decode(input, final=final)
  File "/home/matt/install/root/lib/python3.0/codecs.py", line 300, in decode
   (result, consumed) = self._buffer_decode(data, self.errors, final)
 UnicodeDecodeError: 'utf8' codec can't decode bytes in position 1689-1692: invalid data
</code></pre>

<p>The line in the file it blows up on is "Argentinian", which doesn't seem to be unusual in any way.</p>

<p><strong>Update</strong>: I added,</p>

<pre><code>encoding="iso-8559-1"
</code></pre>

<p>to the open() call, and it fixed the problem.</p>
