Linting fails if module contains module of the same name #4444
Labels
Bug 🪲
False Positive 🦟
A message is emitted but nothing is wrong with the code
Import system
namespace-package
Needs PR
This issue is accepted, sufficiently specified and now needs an implementation
Steps to reproduce
Given multiple files:
Which are all empty, running
pylint a
fails:However, if I rename
a.py
,pylint a
succeeds:Alternatively, I can also
touch a/__init__.py
, but that shouldn't be necessary anymore.Current behavior
Running
pylint a
ifa/a.py
is present fails while searching for an__init__.py
file.Expected behavior
Running
pylint a
ifa/a.py
is present should succeed.pylint --version output
Result of
pylint --version
output:Additional info
This also has some side-effects in module resolution. For example, if I create another file
r.py
:With the content:
Running
pylint -E r
will run fine, butpylint -E r a
will fail. Not just for module a, but for module r as well.Again, if I rename
a.py
toc.py
,pylint -E r a
will work perfectly.The text was updated successfully, but these errors were encountered: