--- a/UtilitiesPython2/pep8.py Wed Jun 29 08:01:51 2011 +0200 +++ b/UtilitiesPython2/pep8.py Wed Jun 29 13:51:58 2011 +0200 @@ -256,9 +256,8 @@ if length > MAX_LINE_LENGTH: try: # The line could contain multi-byte characters - if not hasattr(line, 'decode'): # Python 3 - line = line.encode('latin-1') - length = len(line.decode('utf-8')) + if hasattr(line, 'decode'): # Python 2 only + length = len(line.decode('utf-8')) except UnicodeDecodeError: pass if length > MAX_LINE_LENGTH: