[New-bugs-announce] [issue16504] IDLE - fatal error when opening a file with certain tokenizing errors

Roger Serwy report at bugs.python.org
Sun Nov 18 18:37:09 CET 2012


New submission from Roger Serwy:

IDLE's IndentSearcher class in EditorWindow.py can raise an uncaught IndentationError when opening a file. The attached patch fixes the problem by catching everything that the tokenize module can raise explicitly, namely IndentationError, TokenError, and SyntaxError.

Alternatively, the except clause can be left bare, as it is disappointing to crash IDLE when simply guessing the indent width of a file. (See "guess_indent" in EditorWindow.py)

----------
components: IDLE
files: editor_token_error.patch
keywords: patch
messages: 175895
nosy: serwy
priority: normal
severity: normal
status: open
title: IDLE - fatal error when opening a file with certain tokenizing errors
type: behavior
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file28030/editor_token_error.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16504>
_______________________________________


More information about the New-bugs-announce mailing list