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

pyodbc and pylint static analysis #115

Closed
keitherskine opened this issue May 2, 2016 · 4 comments
Closed

pyodbc and pylint static analysis #115

keitherskine opened this issue May 2, 2016 · 4 comments

Comments

@keitherskine
Copy link
Collaborator

keitherskine commented May 2, 2016

When I run my code through the static analysis tool pylint, I get the following error for all calls to pyodbc.connect():

Module 'pyodbc' has no 'connect' member

I get similar errors for pyodbc exception objects. It appears pylint is not able to ascertain the functions and attributes within the pyodbc module. I don't know how this can fixed (because pyodbc is almost entirely C++), but if it can, it would be kinda handy.

FYI, the workaround I have at the moment is to tell pylint to ignore the pyodbc module entirely, by adding the following line to my pylint config file:

[TYPECHECK]
ignored-modules=pyodbc
@mkleehammer
Copy link
Owner

I don't have the answer, but if you find it, please post it to the Wiki.

@steveoh
Copy link

steveoh commented Jul 1, 2020

Is there not a better solution to this issue?

@giuliohome
Copy link

giuliohome commented Nov 10, 2020

Is there not a better solution to this issue?

Yes the solution is whitelisting pyodbc, so that pylint builds the AST.

For example, I've put

extension-pkg-whitelist=pyodbc

in my .pylintrc

@Commando-Brando
Copy link

Is there not a better solution to this issue?

Yes the solution is whitelisting pyodbc, so that pylint builds the AST.

For example, I've put

extension-pkg-whitelist=pyodbc

in my .pylintrc

I just ran into this error and this fixed it thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants