Skip to content
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

import-self false positive when importing non-existing module from current package #3748

Open
vlad0337187 opened this issue Jul 26, 2020 · 1 comment
Labels
False Positive 🦟 A message is emitted but nothing is wrong with the code Import system Needs PR This issue is accepted, sufficiently specified and now needs an implementation

Comments

@vlad0337187
Copy link

vlad0337187 commented Jul 26, 2020

Steps to reproduce

  1. create some module
  2. try to import non-existing module from current package in __init__.py
  3. run pylint ./

Current behavior

  • raises W0406: Module import itself (import-self)

Expected behavior

  • should raise something like X0000: Module import not found (import-missing)

pylint --version output

pylint 2.5.3
astroid 2.4.2
Python 3.8.3 (default, May 29 2020, 00:00:00) 
[GCC 10.1.1 20200507 (Red Hat 10.1.1-1)]

Reproduce case

  • download this .zip: pylint_false_positive_import_self.zip
  • unpack it
  • make unpacked directory - current (cd command)
  • run pipenv install (to install pylint, create venv)
  • run pipenv run pylint ./
@Pierre-Sassoulas Pierre-Sassoulas added False Positive 🦟 A message is emitted but nothing is wrong with the code Needs PR This issue is accepted, sufficiently specified and now needs an implementation and removed Bug 🪲 labels Jul 2, 2022
@dubiousjim
Copy link

Related issues: #3665, #5151, #6535, #7289

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
False Positive 🦟 A message is emitted but nothing is wrong with the code Import system Needs PR This issue is accepted, sufficiently specified and now needs an implementation
Projects
None yet
Development

No branches or pull requests

4 participants