pylint-bot / test

0 stars 0 forks source link

Since astroid 1.1.0 posix_ipc module can't checked. #157

Closed pylint-bot closed 8 years ago

pylint-bot commented 9 years ago

Originally reported by: h w (BitBucket: vvh, GitHub: @vvh?)


Hi,

with pylint 1.1.0 and astroid 1.0.1 I can check the following code snippet:

#!python
import posix_ipc

class MyQueue(posix_ipc.MessageQueue):
    def __init__(self, p_name = "/MyQueue", p_flags = posix_ipc.O_CREAT, p_mode = 0o600, p_max_messages = 10, p_max_message_size = 8192, p_read = True, p_write = True):
        posix_ipc.MessageQueue.__init__(self, p_name, p_flags, p_mode, p_max_messages, p_max_message_size, p_read, p_write)

def main():
    l_myq = MyQueue()
    del l_myq

if __name__ == '__main__':
    main()

The pylint returns:

#!bash

$ pylint --disable C,R --reports=no pylint-posix_ipc.py
No config file found, using default configuration
$

With the recent versions (astroid 1.3.6 and pylint 1.4.4) I get the following errors:

#!bash

$ pylint --disable C,R --reports=no pylint-posix_ipc.py
No config file found, using default configuration
************* Module pylint-posix_ipc
E:  3,14: Module 'posix_ipc' has no 'MessageQueue' member (no-member)
E:  4,54: Module 'posix_ipc' has no 'O_CREAT' member (no-member)
E:  5, 8: Module 'posix_ipc' has no 'MessageQueue' member (no-member)
$

It look like that astroid/pylint no longer detects members of the posix_ipc module. I use Python 3.3.2+.

Any ideas?

Thank you!


pylint-bot commented 9 years ago

Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore?):


What is posix_ipc?

pylint-bot commented 9 years ago

Original comment by h w (BitBucket: vvh, GitHub: @vvh?):


It is a python module:

posix_ipc python module

posix_ipc Homepage

pylint-bot commented 9 years ago

Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore?):


I see that it's an extension module. Try using this instead and check if it works:

pylint file.py --extension-pkg-whitelist=posix_ipc

pylint-bot commented 9 years ago

Original comment by h w (BitBucket: vvh, GitHub: @vvh?):


Perfect - it works.

Sorry for creating a ticket, I couldn't find a forum and I got no respond on IRC.

pylint-bot commented 9 years ago

Original comment by h w (BitBucket: vvh, GitHub: @vvh?):


With

#!python

--extension-pkg-whitelist=posix_ipc

then it works.