-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
False positives in socket library #4798
Comments
I don't have any problem with the latest pylint, what happen if you use 2.9.6 or the latest master ? |
I updated pylint with pipx and still got the same issue: $ pipx upgrade-all
(...)
upgraded package pylint from 2.8.3 to 2.9.6 (location: /home/dom/.local/pipx/venvs/pylint)
(...)
$ pylint --version
pylint 2.9.6
astroid 2.6.6
Python 3.8.10 (default, May 05 2021, 15:36:36) [GCC]
$ pylint socket_test.py
************* Module socket_test
socket_test.py:13:13: E1101: Module 'socket' has no 'gethostbyname_ex' member (no-member)
socket_test.py:14:7: E1101: Module 'socket' has no 'gaierror' member (no-member)
--------------------------------------------------------------------
Your code has been rated at -2.50/10 (previous run: -2.50/10, +0.00) The master branch did not work for me either: $ pylint --version
pylint 2.10.0-dev0
astroid 2.6.6
Python 3.8.10 (default, May 05 2021, 15:36:36) [GCC]
$ pylint socket_test.py
************* Module socket_test
socket_test.py:13:13: E1101: Module 'socket' has no 'gethostbyname_ex' member (no-member)
socket_test.py:14:7: E1101: Module 'socket' has no 'gaierror' member (no-member)
------------------------------------
Your code has been rated at -2.50/10 Any suggestions? |
Could you provide your list of dependencies ? Or if you don't have one the result of |
I installed $ pip freeze
appdirs==1.4.4
attrs==21.2.0
chardet==4.0.0
cli-test-helpers==1.0.1
iniconfig==1.1.1
ordered-set==4.0.2
packaging==21.0
pep517==0.11.0
pluggy==0.13.1
psutil==5.8.0
py==1.10.0
pycurl==7.43.0.6
PyGObject==3.40.1
pyparsing==2.4.7
pytest==6.2.4
six==1.16.0
toml==0.10.2
tomli==1.2.0
wfuzz==3.1.0
$ pipx list
venvs are in /home/dom/.local/pipx/venvs
apps are exposed on your $PATH at /home/dom/.local/bin
package bpytop 1.0.67, Python 3.8.10
- bpytop
package dirsearch 0.4.2, Python 3.8.10
- dirsearch
package pylint 2.9.6, Python 3.8.10
- epylint
- pylint
- pyreverse
- symilar
package sqlmap 1.5.8, Python 3.8.10
- sqlmap
package virtualenv 20.7.0, Python 3.8.10
- virtualenv |
Still can't reproduce with:
Using the same code and same name, after |
This looks very similar to the problem discussed in #4759 - some modules implemented in C give false-positive In this case it depended on the way Python itself has been installed, but I did not figure out yet what the core problem is. I can confirm that
|
Thanks for the comment @DudeNr33. I can confirm the issue on macOS using Homebrew, too. $ pylint --version
pylint 2.9.6
astroid 2.6.6
Python 3.9.6 (default, Jun 29 2021, 05:25:02)
[Clang 12.0.5 (clang-1205.0.22.9)]
$ pylint socket_test.py
************* Module socket_test
socket_test.py:14:13: E1101: Module 'socket' has no 'gethostbyname_ex' member (no-member)
socket_test.py:15:7: E1101: Module 'socket' has no 'gaierror' member (no-member)
------------------------------------
Your code has been rated at -2.50/10 |
You can try to use |
Thanks for the suggestions. I have no problems with the pylint result since I know that those socket methods do exist. I just wanted to report these false positives. |
Closes pylint-dev#1470 Closes pylint-dev#3499 Closes pylint-dev#4302 Closes pylint-dev#4798 Closes pylint-dev#5081
Bug description
Pylint complains about non existent members in the socket library of Python, although they exist according to the docu.
Sample code:
Configuration
No response
Command used
Pylint output
Expected behavior
Pylint should pass without error.
Pylint version
OS / Environment
openSUSE Tumbleweed
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: