spaces on idles last line
anton at vredegoor.doge.nl
Wed Jul 30 02:29:43 CEST 2003
If editing a script with another editor than Idle (f.e. Scite)
sometimes there are spaces left on the last line. If such a script is
run from the Scite command line with f.e. "pythonw -u idlespace1.py"
the script runs fine. However if next the script is run from Idle,
there is the following error:
Python 2.3b1 (#40, Apr 25 2003, 19:06:24) [MSC v.1200 32 bit (Intel)]
Type "copyright", "credits" or "license" for more information.
IDLE 0.8 -- press F1 for help
IndentationError: unindent does not match any outer indentation level
(idlespace1.py, line 6)
Note that there is no empty last line in this script: the last line
A syntaxerror is also possible:
File "xxxx\xxxx\idlespace2.py", line 2
SyntaxError: invalid syntax
The script that caused the error above:
Saving a script with Idle repairs it immediately, because Idle
automagically adds an empty last line, however a "check module" from
Idle's menu doesn't detect the error. This made it difficult to even
write a script to find out what caused it.
Is there a reason for Idle being stricter than its own checks?
More information about the Python-list