[Idle-dev] Check Module fails w IndentationError

isdale isdale at hrl.com
Thu Jun 29 02:23:54 CEST 2006

I was having problems using IDLE on a python file. If I dont have a shell
open and try to Check Module, nothing happens. If I first open a shell, then
check, I get a traceback printed.

Here is a simple python script that causes the error:

msg = "testing Idle indent z bug"
print msg
for c in msg:
  if c == "z":
      print "Found z"
    print c
notice the "print c" is not indented the same as the if line
here is the traceback from a shell with IDLE...
Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Python24\lib\lib-tk\Tkinter.py", line 1347, in __call__
    return self.func(*args)
  File "C:\Python24\lib\idlelib\ScriptBinding.py", line 63, in
    if not self.tabnanny(filename):
  File "C:\Python24\lib\idlelib\ScriptBinding.py", line 70, in tabnanny
  File "C:\Python24\lib\tabnanny.py", line 277, in process_tokens
    for (type, token, start, end, line) in tokens:
  File "C:\Python24\lib\tokenize.py", line 229, in generate_tokens
    raise IndentationError(
IndentationError: unindent does not match any outer indentation level
Traceback (most recent call last):
  File "C:\Python24\lib\logging\__init__.py", line 738, in emit
  File "C:\Python24\lib\logging\__init__.py", line 716, in flush
IOError: [Errno 9] Bad file descriptor

View this message in context: http://www.nabble.com/Check-Module-fails-w-IndentationError-tf1864880.html#a5095222
Sent from the Python - idle-dev forum at Nabble.com.

More information about the IDLE-dev mailing list