I have the following code example:
#!/usr/bin/python3
'''Why do I get the pylint error Module 'socket' has no 'gethostname' member (no-member)?'''
import socket
print(socket.gethostname())
Which runs fine and prints the hostname as output.
However, when I check with pylint I get an error:
% pylint testSocket.py
************* Module testSocket
testSocket.py:7:6: E1101: Module 'socket' has no 'gethostname' member (no-member)
----------------------------------------------------------------------
Your code has been rated at -15.00/10 (previous run: -20.00/10, +5.00)
%
This is a super-trimmed down example. In my full-fledged code I play with other socket functions such as socket.getfqdn(), or socket.gethostbyname(nDict['HOST_FQDN']) with no pylint issues.
Even within the socket module it includes the following line under Functions:
gethostname() -- return the current hostname
How can I get a clean run of pylint? (Without resorting to # pylint: disable=E1101)
Python 3.8.2, pylint 2.7.2