[New-bugs-announce] [issue10117] Tools/scripts/reindent.py fails on non-UTF-8 encodings

Alexander Belopolsky report at bugs.python.org
Fri Oct 15 18:54:42 CEST 2010

New submission from Alexander Belopolsky <belopolsky at users.sourceforge.net>:

Tools/scripts/reindent.py -d Lib/test/encoded_modules/module_koi8_r.py
Traceback (most recent call last):
  File "Tools/scripts/reindent.py", line 310, in <module>
  File "Tools/scripts/reindent.py", line 93, in main
  File "Tools/scripts/reindent.py", line 114, in check
    r = Reindenter(f)
  File "Tools/scripts/reindent.py", line 162, in __init__
    self.raw = f.readlines()
  File "Lib/codecs.py", line 300, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xf0 in position 59: invalid continuation byte

Attached patch fixes this issue.

components: Demos and Tools
files: reindent.diff
keywords: needs review, patch
messages: 118804
nosy: belopolsky
priority: normal
severity: normal
status: open
title: Tools/scripts/reindent.py fails on non-UTF-8 encodings
type: behavior
versions: Python 3.2
Added file: http://bugs.python.org/file19245/reindent.diff

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list