pocket-lint does not catch unindent exception during tokenize

Bug #610888 reported by Edwin Grubbs
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PEP 8
New
Undecided
Unassigned

Bug Description

Pocketlint reports an indentation error just fine, but an unindentation error is an uncaught exception.

Traceback (most recent call last):
  File "<string>", line 24, in <module>
  File "<string>", line 34, in check
  File "/usr/lib/pymodules/python2.6/pocketlint/formatcheck.py", line 234, in check
    PythonChecker(self.file_path, self.text, self._reporter).check()
  File "/usr/lib/pymodules/python2.6/pocketlint/formatcheck.py", line 375, in check
    self.check_pep8()
  File "/usr/lib/pymodules/python2.6/pocketlint/formatcheck.py", line 404, in check_pep8
    pep8.Checker(self.file_path).check_all()
  File "/usr/lib/pymodules/python2.6/pocketlint/contrib/pep8.py", line 620, in check_all
    for token in tokenize.generate_tokens(self.readline_check_physical):
  File "/usr/lib/python2.6/tokenize.py", line 346, in generate_tokens
    ("<tokenize>", lnum, pos, line))
  File "<tokenize>", line 9
    x = one
    ^
IndentationError: unindent does not match any outer indentation level

You can trigger this with the following code:

class Foo:
    def one():
>>>>>>>>>>>>>>>>>
        pass

    x = one

Curtis Hovey (sinzui)
affects: pocket-lint → pep8
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.