[issue5129] indentation in IDLE 2.6 different from IDLE 2.5, 2.4 or vim
New submission from sy12 : platform: Windows XP In a file (cf attached file) with mixed tabs and spaces, the line following "else:" appears at the same level than "else:", while the file probably still works with Python 2.6. At least, IDLE 2.5 or IDLE 2.4 or vim don't have this problem. -- components: IDLE files: bug.py messages: 80941 nosy: sy12 severity: normal status: open title: indentation in IDLE 2.6 different from IDLE 2.5, 2.4 or vim type: behavior versions: Python 2.6 Added file: http://bugs.python.org/file12918/bug.py ___ Python tracker <http://bugs.python.org/issue5129> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5129] indentation in IDLE 2.6 different from IDLE 2.5, 2.4 or vim
sy12 added the comment: The problem appeared in the initial display, with a file similar to bug.py. Here is how to reproduce it: 1. open the bug.py file with IDLE 2.5 (or with Firefox from the bugs.python.org website): the display shows the file the way the compiler will (probably) see it; 2. open the bug.py file with IDLE 2.6: the line 7 (just after "else:") is displayed differently. Summary: IDLE 2.6 doesn't display the indentation that the compiler will see. - About the secondary problem with Untabify (discovered when trying to solve the display problem without having to reinstall Python 2.5): Actually, Untabify is more a solution than a problem, except maybe that the only safe value is 8 spaces for a tabulation. Using a different value on legacy code (old code without tests) might add subtle bugs. According to the Python Language Reference: "First, tabs are replaced (from left to right) by one to eight spaces such that the total number of characters up to and including the replacement is a multiple of eight (this is intended to be the same rule as used by Unix)." - ___ Python tracker <http://bugs.python.org/issue5129> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5129] indentation in IDLE 2.6 different from IDLE 2.5, 2.4 or vim
sy12 added the comment: IDLE's "untabify" feature (required by IDLE 2.6 when running from IDLE) seems to do the job correctly but this function doesn't inspire trust and might damage the code, because IDLE 2.6 is not able to correctly display mixed spaces and tabs (maybe for a reason linked to python 3 but I didn't find it in the logs, so maybe it's just a bug) and because of the default value given by the dialog, quite frightening: 4 spaces for a tab, instead of 8. By giving 8 the problem seems to be solved, even for IDLE 2.6. Maybe IDLE 2.6 is assuming by default that a tab is 4 spaces? ___ Python tracker <http://bugs.python.org/issue5129> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com