pylint icon indicating copy to clipboard operation
pylint copied to clipboard

Pylint doesn't detect AttributeError when using PyQt5

Open apoullet opened this issue 7 years ago • 1 comments

Steps to reproduce

  1. Create a new directory and initiate a virtual environment in that directory using virtualenv
  2. Install pylint and PyQt5 using the venv's pip
  3. Create an rcfile for pylint (using pylint --generate-rcfile) and add PyQt5 to the extension-pkg-whitelist
  4. Write some code in python requesting an attribute that doesn't exist e.g.
import sys

from PyQt5 import QtWidgets


def create_window():
    app = QtWidgets.QApplication(sys.argv)
    window = QtWidgets.QWidget()
    window.definitely_not_one_of_its_attributes()
    window.show()

create_window()

Current behavior

When running pylint on the file it informs me that my code has been rated at 6.67/10.0 and that other than some missing docstrings there are no errors.

Expected behavior

Pylint should tell me that 'definitely_not_one_of_its_attributes' isn't an attribute of QWidget, which is the error message that I get when I try to run the code.

pylint --version output

pylint 2.1.1 astroid 2.0.4 Python 3.7.0 (default, Aug 22 2018, 15:22:33) [Clang 9.1.0 (clang-902.0.39.2)]

apoullet avatar Oct 15 '18 01:10 apoullet

Thanks, will check why we don't emit for this.

PCManticore avatar Oct 15 '18 08:10 PCManticore