Tabnanny errors when Migrating Python 2.4 code to 2.5

Mike Driscoll kyosohma at gmail.com
Sat Jan 5 10:07:13 EST 2008


>> I'm using Windows XP, using IDLE (which was mentioned already)

> in the context of editing/displaying code, not executing it. Does the
> problem occur before or after you edit a file with IDLE?

Actually, neither. I'm not editing the code. I open it in IDLE in 2.5
and attempt to run it through the Run menu "Run Module" menu item or
by pressing F5. It immediately fails with a tabnanny error. If I run
it from 2.4's IDLE, it works.

>> and I
>> downloaded the 2.5.1 exe/msi file from python.org to install it.

> What you downloaded doesn't answer the question about how you
> installed it. Do you still have your 2.4 installation?

Yes, I use both 2.4 and 2.5 as I migrate from one to the other. I've
attached a file that causes it consistently. On two systems with both
2.4 and 2.5 installed, it fails on line 206 when run from the IDLE
included with 2.5.

>> I have yet to find a simple one which exhibits the issue to post. It
>> seems to happen to my complex files, not the simple ones.

> So chop up a complex file ...
> Have you inspected the failing files using a text editor that can
> display tabs and spaces (e.g. PythonWin, TextPad)?

I just used Notepad++ to inspect the file and it does indeed have tabs
at line 206 rather than spaces. I take it that Python 2.5 is more
sensitive to that than is 2.4? I program almost exclusively in IDLE as
I'd read that this can happen in some text editors, but it seemed
implied that it didn't if you used IDLE. At least, that's what I got
from various Python books and the website:
http://www.python.org/idle/doc/idlemain.html

Anyway, thanks for the help.

Mike
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: scrubber.py
URL: <http://mail.python.org/pipermail/python-list/attachments/20080105/9ac4e4f3/attachment-0001.ksh>


More information about the Python-list mailing list