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

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

Open
eugene57 opened this issue Oct 8, 2024 · 0 comments

Comments

@eugene57
Copy link

eugene57 commented Oct 8, 2024

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.

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

1 participant