Skip to content

modutils._get_relative_base_path returns incorrect result when directory name starts with directory name in path_to_check #2608

Closed
@eugene57

Description

@eugene57

Consider following call: astroid.modutils._get_relative_base_path('something', os.path.join(os.getcwd(), 'some')).
I would expect this to return None by design. However, this returns 'thing' instead.

This results in issues with running pylint on a project with following directory structure:

some
\- __init__.py
something
\- __init__.py
thing
\- __init__.py

I have observed this in astroid version 3.1.0, but it seems to me that the code in master is still the same.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions