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

pylint doesn't recognize http.client members in python 3 #2687

Closed
halbii opened this issue Jan 10, 2019 · 1 comment
Closed

pylint doesn't recognize http.client members in python 3 #2687

halbii opened this issue Jan 10, 2019 · 1 comment
Labels
Bug 🪲 Good first issue Friendly and approachable by new contributors Needs astroid Brain 🧠 Needs a brain tip in astroid (then an astroid upgrade)

Comments

@halbii
Copy link

halbii commented Jan 10, 2019

Steps to reproduce

  1. Install python 3.6.5 on Windows 10 or Ubuntu 18
  2. Create a python file including:

import http.client
a = http.client.OK # or another member, e.g. UNAUTHORIZED

  1. run pylint -E [path/to/file]

Current behavior

pylint does not recognize the member

Expected behavior

pylint recognizes http.client's members

pylint --1.8.4 or pylint --2.2.2 output

Module 'http.client' has no 'OK' member (no-member)

@PCManticore PCManticore added Bug 🪲 Good first issue Friendly and approachable by new contributors Needs astroid Brain 🧠 Needs a brain tip in astroid (then an astroid upgrade) labels Jan 13, 2019
@PCManticore
Copy link
Contributor

Thanks for reporting an issue! pylint does not know those members because they are added dynamically using globals(). We should add a brain inference file in astroid to make those recognisable.

clrpackages pushed a commit to clearlinux-pkgs/astroid that referenced this issue Feb 28, 2019
…ed single and double quotes.

Azeem Bande-Ali (1):
      Docs: Fixing transformation example to be functional (#640)

Benjamin Elven (1):
      Added 2 more missing _ssl constants (#648)

Bianca Power (1):
      Fix typo in description for brain_attrs (#638)

Claudiu Popa (48):
      Add reversed() to Enum classes
      Use a string for the name of the enum instead of grabbing it as a variable
      Added special support for `enum.IntFlag`
      Pin typed_ast so a new release won't break the pylint's pragmas
      Fix a bug where an Attribute used as a base class was triggering a crash
      Add missing _ssl constant. Close pylint-dev/pylint#2629
      ``typing`` types have the `__args__` property. Close pylint-dev/pylint#2419
      Make sure the test does not crash if the directory already exists
      Revert path copying in InferenceContext()
      Prevent crashing when processing ``enums`` with mixed single and double quotes.
      Move infer_name_module() in pylint and remove it from here
      Remove test that does not work actually work consistently on all Python versions
      Disable the pylint job until we fix the clone inference bugs
      Revert "Disable the pylint job until we fix the clone inference bugs"
      Add brain tips for `http.client`. Close pylint-dev/pylint#2687
      Revert "Remove the restore_path() method"
      Add a registry for builtin exception models. Close pylint-dev/pylint#1432
      Disable test on Python 3.4
      Change the filter to use equal
      Use a different prefix for the object model methods
      Added more builtin exceptions attributes. Close #580
      Remove StopIteration handling which should not leak at all from inference
      Replace a couple of returns with explicit InferenceError exceptions
      Make sure that Attribute.infer has a protection against StopIterations
      Add a method to the manager to retrieve the builtins module
      Remove the restriction that "old style classes" cannot have a MRO.
      Remove inadvertent test which still does not have a fix
      Adjust the pull request template a little bit
      Make the astroid bootstrapping take care of builtins such as Generator
      Prepare a dev release
      Fix a recursion error caused by inferring the ``slice`` builtin.
      Bump typed_ast to 1.2.0
      ``brain_numpy`` returns an undefined type for ``numpy`` methods to avoid ``assignment-from-no-retur
      Remove inadvertent returns from class bodies
      Fix a crash in the ``enum`` brain tip caused by non-assign members in class definitions.
      Support non-const nodes as values of Enum attributes.
      Add a proper ``strerror`` inference to the ``OSError`` exceptions.
      Fix a crash with ``typing.NamedTuple`` and empty fields. Close pylint-dev/pylint#2745
      Update to typed-ast 1.3 and drop the Python 3.7 restriction
      Install typed ast 1.3 for Python 3.7 and earlier versions for Python 3.6
      Do a new dev release
      Use the same versions in tox as in __pkginfo__
      Use the right pytest methods for setup and teardown
      Don't clear the manager caching any longer
      Remove merge marker
      Prepare 2.2.0
      Disable test that does not make sense on versions older than Python 3.6
      When picking the parse function, make sure to parse with the right minor version

Nick Drozd (1):
      Cut generator flags

Peter Talley (1):
      Add new Popen kwarg 'text' in Python 3.7

Tomas Gavenciak (2):
      Remove else after return/raise
      Extend detection of classes defined with attr

hippo91 (11):
      Just breakpoint to debug and mark the origin of the problem
      Revert "Just breakpoint to debug and mark the origin of the problem"
      Refactoring chained comparison (#636)
      Avoid statement deletion in the _filter_stmts method of the LookupMixin class for PartialFunction
      Adding support for unary operators for numpy ndarray and numbers. Adding hook to filter results of infer_call_result from list and tuples for function array and linspace
      Refactoring to code DRY
      Add a unittest checking that the call to numpy.array function is not inferred as a list or a tuple
      Refactors and generalizes unittests dealing with tuple or list inference of numpy function calls
      Add of ChangeLog entry
      Format according to Black
      Add support of unary operators to numpy types.

What's New in astroid 2.2.0?
============================
Release Date: 2019-02-27

* Fix a bug concerning inference of calls to numpy function that should not return Tuple or List instances.

 Close pylint-dev/pylint#2436

* ``typed_ast`` gets installed for Python 3.7, meaning type comments can now work on 3.7.

* Fix a bug concerning inference of unary operators on numpy types.

  Close pylint-dev/pylint#2436 (first part)

(NEWS truncated at 15 lines)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🪲 Good first issue Friendly and approachable by new contributors Needs astroid Brain 🧠 Needs a brain tip in astroid (then an astroid upgrade)
Projects
None yet
Development

No branches or pull requests

2 participants