New submission from Roger Serwy:

IDLE's IndentSearcher class in 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" 

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:

Python tracker <>
Python-bugs-list mailing list

Reply via email to