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

pylint 1.3.1 (and astroid) fails: AttributeError: 'Class' object has no attribute '_is_subtype_of' #75

Closed
jquast opened this issue Dec 4, 2014 · 5 comments

Comments

@jquast
Copy link
Contributor

jquast commented Dec 4, 2014

I'd like to help remove the bounded constraint of excluding pylint 1.4.

Is there anything we do?

Do we need to make pylint compatible with python2.6 upstream to resolve it?

I have a bug that is resolved in pylint 1.4, but I am unable to pin the requirements without raising a VersionConflict due to the _INSTALL_REQUIRES in setup.py by @carlio 78369b0

Bug is simple to reproduce, given a file containing

import json

class JSONCustomEncoder(json.JSONEncoder):
    def default(self, obj):
            super(JSONCustomEncoder, self).default(obj)

and using prospector's argument --die-on-tool-error:

Traceback (most recent call last):
  File "/Users/jquast/.virtualenvs/prospector/bin/prospector", line 9, in <module>
    load_entry_point('prospector==0.7.4', 'console_scripts', 'prospector')()
  File "/Users/jquast/.virtualenvs/prospector/lib/python2.7/site-packages/prospector/run.py", line 320, in main
    prospector.execute()
  File "/Users/jquast/.virtualenvs/prospector/lib/python2.7/site-packages/prospector/run.py", line 227, in execute
    messages += tool.run()
  File "/Users/jquast/.virtualenvs/prospector/lib/python2.7/site-packages/prospector/tools/pylint/__init__.py", line 182, in run
    self._linter.check(self._args)
  File "/Users/jquast/.virtualenvs/prospector/lib/python2.7/site-packages/pylint/lint.py", line 585, in check
    self.check_astroid_module(astroid, walker, rawcheckers, tokencheckers)
  File "/Users/jquast/.virtualenvs/prospector/lib/python2.7/site-packages/pylint/lint.py", line 662, in check_astroid_module
    walker.walk(astroid)
  File "/Users/jquast/.virtualenvs/prospector/lib/python2.7/site-packages/pylint/utils.py", line 804, in walk
    self.walk(child)
  File "/Users/jquast/.virtualenvs/prospector/lib/python2.7/site-packages/pylint/utils.py", line 804, in walk
    self.walk(child)
  File "/Users/jquast/.virtualenvs/prospector/lib/python2.7/site-packages/pylint/utils.py", line 801, in walk
    cb(astroid)
  File "/Users/jquast/.virtualenvs/prospector/lib/python2.7/site-packages/pylint/checkers/classes.py", line 351, in visit_function
    and klass._is_subtype_of(overridden_frame.qname())):
AttributeError: 'Class' object has no attribute '_is_subtype_of'

This was resolved in Nov. 23rd release, https://bitbucket.org/logilab/pylint/commits/6ef255203c84ed2210bf81be4c64cd1f566f953f

@carlio
Copy link
Member

carlio commented Dec 5, 2014

@jquast I'm planning a new release (0.8) of prospector this weekend which would include pylint 1.4 - I wanted to include #74 in the new release as well but it took a bit longer than expected!

@jquast
Copy link
Contributor Author

jquast commented Dec 5, 2014

Hey that's great, it looked like it was going that direction. Thanks carlio.

(There does appear to be motion towards finally sunsetting python2.6 in the community -- many other supporting test/linters I use to run tests to maintain py2.6 compatibility are continually slipping regressions with newer updates. Onward to 3.4!)

@jquast
Copy link
Contributor Author

jquast commented Jan 2, 2015

reference: #73, #76, #79

@jquast jquast changed the title pylint requirement is restricting use of 1.4 (>=1.3,<1.4), but bugfixes continue in 1.4 pylint 1.3.1 (and astroid) fails: AttributeError: 'Class' object has no attribute '_is_subtype_of' Jan 2, 2015
@carlio
Copy link
Member

carlio commented Jan 2, 2015

The 0.8 release which just appeared will fix this, see #73 (comment)

@carlio
Copy link
Member

carlio commented Jan 2, 2015

0.8 is now on pypi! Sorry for the delay, Christmas and all that you know, 🍰 and 🍻

@carlio carlio closed this as completed Jan 2, 2015
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

2 participants