Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions doc/whatsnew/fragments/10969.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Fix an issue where discovery can miss a similarly named directory if a shorter named directory is processed first.

If you have directories named say `applications` and `applications_api` in a
project, and the former is encountered by the tree walk first during discovery,
the second directory would be skipped even if it was a valid package. This fixes
the issue by appending the OS filepath separator to the name in the case where
the path was known to be a directory due to having an `__init__.py` in it.
2 changes: 1 addition & 1 deletion pylint/lint/pylinter.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ def _discover_files(self, files_or_modules: Sequence[str]) -> Iterator[str]:
continue

if "__init__.py" in files:
skip_subtrees.append(root)
skip_subtrees.append(root + os.sep)
yield root
else:
yield from (
Expand Down
Loading