Skip to content

False positive syntax-error for badly placed type annotations #3757

Open
@ghost

Description

Steps to reproduce

  1. Install "pyinputplus" with pip3
  2. Make a file with content of "import pyinputplus"
  3. Run code in vsCode, and look at the "problems" and/or output section to see output from PyLint

Current behavior

I posted a similar issue in the repo of the python extension for vsCode (Made by microsoft), but they said it was an issue with PyLint. The current behaviour is this:

When I run my code, the "problem" output looks like this:

Cannot import 'pyinputplus' due to syntax error 'invalid syntax (<unknown>, line 268)'

The output looks like this:

##########Linting Output - pylint##########
************* Module error
1,0,error,syntax-error:Cannot import 'pyinputplus' due to syntax error 'invalid syntax (<unknown>, line 268)'

-------------------------------------
Your code has been rated at -40.00/10

Expected behavior

Expected behaviour is a code being able to run, with no errors shown.

pylint --version output

2.5.2

What I tried

I tried reload VSCode, reinstall it and I tried reinstalling the module. I checked the path and python versions, and everything was good. I'm not 100% sure if this is a bug, but I can't get it to work properly, so I suppose it is a bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    AstroidRelated to astroidBug 🪲Needs astroid updateNeeds an astroid update (probably a release too) before being mergableNeeds decision 🔒Needs a decision before implemention or rejection

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions