Skip to content

False positive E0001 report for # type: line #9257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
CareF opened this issue Nov 22, 2023 · 1 comment
Closed

False positive E0001 report for # type: line #9257

CareF opened this issue Nov 22, 2023 · 1 comment
Labels
Duplicate 🐫 Duplicate of an already existing issue

Comments

@CareF
Copy link
Contributor

CareF commented Nov 22, 2023

Bug description

pylint fails to parse comment lines starting with type:

"""a.py file"""

# type: abc

def foobar():
    """aaa"""
    return 1

Configuration

No response

Command used

pylint a.py

Pylint output

************* Module a
a.py:4:9: E0001: Parsing failed: 'invalid syntax (<unknown>, line 4)' (syntax-error)

Expected behavior

no error

Pylint version

pylint 3.0.2
astroid 3.0.1
Python 3.11.6 (main, Oct  2 2023, 13:45:54) [Clang 15.0.0 (clang-1500.0.40.1)]

OS / Environment

MacOS

Additional dependencies

No response

@CareF CareF added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Nov 22, 2023
@DanielNoord
Copy link
Collaborator

This is correct, # type has syntactic meaning and this can't be parsed correctly.

As such this is a duplicate of #3757.

@DanielNoord DanielNoord closed this as not planned Won't fix, can't repro, duplicate, stale Nov 23, 2023
@DanielNoord DanielNoord added Duplicate 🐫 Duplicate of an already existing issue and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate 🐫 Duplicate of an already existing issue
Projects
None yet
Development

No branches or pull requests

2 participants