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 <rep...@bugs.python.org>
<http://bugs.python.org/issue16504>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to