PyCQA / pycodestyle

Simple Python style checker in one Python file
https://pycodestyle.pycqa.org
Other
5.01k stars 755 forks source link

E901: not detected in Python 3.12.0 #1204

Closed hhatto closed 10 months ago

hhatto commented 10 months ago

input a Python code that contains a syntax error as follows:

# inalid.py is invalid python code
def tmp(g):
    g(4)))

    if not True:
        pass
        pass

When running pycodestyle v2.11.0 in a Python 3.11.6 environment, I get the following output:

invalid.py:4:5: E122 continuation line missing indentation or outdented
invalid.py:7:1: E901 TokenError: EOF in multi-line statement

However, when running pycodestyle v2.11.0 in a Python 3.12.0 environment, the output was as follows, and E901 was not detected:

invalid.py:4:5: E122 continuation line missing indentation or outdented

Is this the expected behavior?

Environment

asottile commented 10 months ago

yeah there's unfortunately nothing we can do about this since it now crashes the tokenizer. I reported this during the alpha of 3.12 and it was decided to be too minor to address

hhatto commented 10 months ago

I see. Thanks