[New-bugs-announce] [issue15332] 2to3 should fix bad indentation (or warn about it)

Jakub Wilk report at bugs.python.org
Thu Jul 12 16:44:43 CEST 2012


New submission from Jakub Wilk <jwilk at jwilk.net>:

Python 3 is more rigid about mixing tabs and spaces within a single file. 2to3 should either fix indentation that would become a syntax error in Python 3.X, or maybe issue a warning about it (or both).

Example:

$ python badtabs.py && echo okay
okay

$ 2to3 badtabs.py 
RefactoringTool: Skipping implicit fixer: buffer
RefactoringTool: Skipping implicit fixer: idioms
RefactoringTool: Skipping implicit fixer: set_literal
RefactoringTool: Skipping implicit fixer: ws_comma
RefactoringTool: No files need to be modified.

$ python3 badtabs.py && echo okay
  File "badtabs.py", line 3
    'b'
      ^
TabError: inconsistent use of tabs and spaces in indentation

----------
components: 2to3 (2.x to 3.x conversion tool)
files: badtabs.py
messages: 165303
nosy: jwilk
priority: normal
severity: normal
status: open
title: 2to3 should fix bad indentation (or warn about it)
Added file: http://bugs.python.org/file26365/badtabs.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15332>
_______________________________________


More information about the New-bugs-announce mailing list