from os import makedirs
def makedirs():
pass
pylint newfile.pyTraceback (most recent call last):
File "/Users/jacques/miniconda/bin/pylint", line 11, in <module>
sys.exit(run_pylint())
File "/Users/jacques/miniconda/lib/python3.6/site-packages/pylint/__init__.py", line 16, in run_pylint
Run(sys.argv[1:])
File "/Users/jacques/miniconda/lib/python3.6/site-packages/pylint/lint.py", line 1347, in __init__
linter.check(args)
File "/Users/jacques/miniconda/lib/python3.6/site-packages/pylint/lint.py", line 768, in check
self._do_check(files_or_modules)
File "/Users/jacques/miniconda/lib/python3.6/site-packages/pylint/lint.py", line 901, in _do_check
self.check_astroid_module(ast_node, walker, rawcheckers, tokencheckers)
File "/Users/jacques/miniconda/lib/python3.6/site-packages/pylint/lint.py", line 980, in check_astroid_module
walker.walk(ast_node)
File "/Users/jacques/miniconda/lib/python3.6/site-packages/pylint/utils.py", line 1014, in walk
self.walk(child)
File "/Users/jacques/miniconda/lib/python3.6/site-packages/pylint/utils.py", line 1011, in walk
cb(astroid)
File "/Users/jacques/miniconda/lib/python3.6/site-packages/pylint/checkers/base.py", line 505, in visit_functiondef
self._check_redefinition(node.is_method() and 'method' or 'function', node)
File "/Users/jacques/miniconda/lib/python3.6/site-packages/pylint/checkers/base.py", line 717, in _check_redefinition
if dummy_variables_rgx and dummy_variables_rgx.match(defined_self.name):
AttributeError: 'ImportFrom' object has no attribute 'name'
No exception
No config file found, using default configuration
pylint 1.8.1,
astroid 1.6.0
Python 3.6.3 | packaged by conda-forge | (default, Dec 9 2017, 16:20:51)
[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)]
Seems like https://github.com/PyCQA/pylint/pull/1665 might be the source of this. Maybe the line just needs to be:
if dummy_variables_rgx and dummy_variables_rgx.match(defined_self.names[0][0]):
+1 Same here, problem with ImportForm and name attribute
File "/usr/local/lib/python2.7/dist-packages/django_jenkins/tasks/run_pylint.py", line 44, in run
lint.Run(args, reporter=ParseableTextReporter(output=output), exit=False)
File "/usr/local/lib/python2.7/dist-packages/pylint/lint.py", line 1347, in __init__
linter.check(args)
File "/usr/local/lib/python2.7/dist-packages/pylint/lint.py", line 768, in check
self._do_check(files_or_modules)
File "/usr/local/lib/python2.7/dist-packages/pylint/lint.py", line 901, in _do_check
self.check_astroid_module(ast_node, walker, rawcheckers, tokencheckers)
File "/usr/local/lib/python2.7/dist-packages/pylint/lint.py", line 980, in check_astroid_module
walker.walk(ast_node)
File "/usr/local/lib/python2.7/dist-packages/pylint/utils.py", line 1014, in walk
self.walk(child)
File "/usr/local/lib/python2.7/dist-packages/pylint/utils.py", line 1011, in walk
cb(astroid)
File "/usr/local/lib/python2.7/dist-packages/pylint/checkers/base.py", line 463, in visit_classdef
self._check_redefinition('class', node)
File "/usr/local/lib/python2.7/dist-packages/pylint/checkers/base.py", line 717, in _check_redefinition
if dummy_variables_rgx and dummy_variables_rgx.match(defined_self.name):
AttributeError: 'ImportFrom' object has no attribute 'name'
Same thing here. I was going to open the very same issue. My MWE was:
~py
from argparse import ArgumentParser
class ArgumentParser:
pass
~
Given the original message of this thread, I think that the bug arises when one redefines an existing function/class.
Good luck! 馃檪
Thanks for the report!
@PCManticore is this currently in the 1.8.1 version? I am still getting this error at the moment
@ransom4real it's not in any released versions, you'll need to use 1.8 or master branches I believe. I'm using the 1.8 branch myself.
Do you know when it will be released in a next version? (thanks for the work anyway!)
When I'll have time. Unfortunately I'm a bit busy at the moment, but hopefully I'll find some time in the weekend for a new release
@PCManticore ok thank you :)
Most helpful comment
When I'll have time. Unfortunately I'm a bit busy at the moment, but hopefully I'll find some time in the weekend for a new release