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: 'Name' object has no attribute 'expr' #79

Closed
jquast opened this issue Jan 2, 2015 · 1 comment

Comments

@jquast
Copy link
Contributor

jquast commented Jan 2, 2015

another case where pylint 1.4 resolves the issue, just like #73, #75, #76. Just putting it here for issue tracking to help other folk who find the issue.

$ cat z/xyz.py << EOF
from __future__ import print_function

msg_rest = u'{0}'.format

print(msg_rest(1))
EOF
$ touch z/__init__.py
$ prospector -X z
  File "/Users/jquast/.virtualenvs/x84/bin/prospector", line 9, in <module>
    load_entry_point('prospector==0.7.4', 'console_scripts', 'prospector')()
  File "/Users/jquast/.virtualenvs/x84/lib/python2.7/site-packages/prospector/run.py", line 320, in main
    prospector.execute()
  File "/Users/jquast/.virtualenvs/x84/lib/python2.7/site-packages/prospector/run.py", line 227, in execute
    messages += tool.run()
  File "/Users/jquast/.virtualenvs/x84/lib/python2.7/site-packages/prospector/tools/pylint/__init__.py", line 182, in run
    self._linter.check(self._args)
  File "/Users/jquast/.virtualenvs/x84/lib/python2.7/site-packages/pylint/lint.py", line 585, in check
    self.check_astroid_module(astroid, walker, rawcheckers, tokencheckers)
  File "/Users/jquast/.virtualenvs/x84/lib/python2.7/site-packages/pylint/lint.py", line 662, in check_astroid_module
    walker.walk(astroid)
  File "/Users/jquast/.virtualenvs/x84/lib/python2.7/site-packages/pylint/utils.py", line 804, in walk
    self.walk(child)
  File "/Users/jquast/.virtualenvs/x84/lib/python2.7/site-packages/pylint/utils.py", line 804, in walk
    self.walk(child)
  File "/Users/jquast/.virtualenvs/x84/lib/python2.7/site-packages/pylint/utils.py", line 804, in walk
    self.walk(child)
  File "/Users/jquast/.virtualenvs/x84/lib/python2.7/site-packages/pylint/utils.py", line 801, in walk
    cb(astroid)
  File "/Users/jquast/.virtualenvs/x84/lib/python2.7/site-packages/pylint/checkers/strings.py", line 339, in visit_callfunc
    self._check_new_format(node, func)
  File "/Users/jquast/.virtualenvs/x84/lib/python2.7/site-packages/pylint/checkers/strings.py", line 348, in _check_new_format
    if not isinstance(node.func.expr, astroid.Const):
AttributeError: 'Name' object has no attribute 'expr'
@carlio
Copy link
Member

carlio commented Jan 2, 2015

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

@jquast jquast closed this as completed Jan 4, 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