[Python-projects] Pylint bug: false error message "Module 'pysvn' has no 'wc_status_kind' member".

Sylvain Thénault sylvain.thenault at logilab.fr
Fri Feb 9 12:18:10 CET 2007


On Friday 09 February à 11:04, Barry Scott wrote:
> Sylvain Thénault wrote:
> >On Friday 09 February à 10:19, Barry Scott wrote:
> >  
> >>Sylvain Thénault wrote:
> >>    
> >>>On Thursday 08 February à 16:55, Barry Scott wrote:
> >>>      
> >>>>Is pylint failing to find wc_status_kind because its defined in a 
> >>>>python extension?
> >>>>
> >>>>The pysvn module import * from _pysvn and _pysvn is an extension.
> >>>>   
> >>>>        
> >>>well, it might be if _pysvn C defined objects don't have __module__
> >>>correctly set to '_pysvn' in this case.
> >>>      
> >>What do you mean by correctly set? How does pylint figure out the members 
> >>of
> >>an extension module? Why do you need __module__ set and on what?
> >>
> >>I happy to change pysvn to get this working once I understand the issue.
> >>    
> >
> >that's because when it build astng representation for C extension
> >module, it has to check the __module__ attribute of objects found 
> >in the module (using dir(module)) to check they are actually belonging
> >to this module. Without that, it may get a wrong representation of this
> >module or even goes into possible infinite recursion problems.
> >
> >  
> o.k. for my objects you need me to return __module__. I take it that for 
> int and string
> etc you just record that then variable exists. For example the copyright 
> variable in pysvn
> is a PyString.

yep, but in this case the name will be added anyway as a local of the 
module. So this make me think that it's not the original poster problem,
this should not occurs with module level name, it usually occurs on
method/attribute of classes in the module (since if __module__ doesn't 
match, there is no recursion on the object to find its methods and
attributes).

-- 
Sylvain Thénault                               LOGILAB, Paris (France)
Formations Python, Zope, Plone, Debian:  http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
Python et calcul scientifique:           http://www.logilab.fr/science



More information about the Python-Projects mailing list