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

Don't resolve symlinks. #2128

Closed
wants to merge 1 commit into from
Closed

Don't resolve symlinks. #2128

wants to merge 1 commit into from

Conversation

smurfix
Copy link

@smurfix smurfix commented Apr 19, 2023

Type of Changes

Type
🐛 Bug fix

Description

This patch removes code that resolves symlinks when resolving a module path.

This causes problems, as described in the linked-to bug, and IMHO since the Python interpreter doesn't resolve symlinks there's no good reason why a code analyzer should do so.

Closes: #2127.

@codecov
Copy link

codecov bot commented Apr 19, 2023

Codecov Report

Merging #2128 (c3b1b43) into main (ae9ce82) will decrease coverage by 0.01%.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2128      +/-   ##
==========================================
- Coverage   92.73%   92.72%   -0.01%     
==========================================
  Files          94       94              
  Lines       11007    11004       -3     
==========================================
- Hits        10207    10204       -3     
  Misses        800      800              
Flag Coverage Δ
linux 92.44% <ø> (-0.01%) ⬇️
pypy 87.87% <ø> (-0.01%) ⬇️
windows 92.28% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
astroid/modutils.py 87.18% <ø> (-0.14%) ⬇️

@DanielNoord
Copy link
Collaborator

Could you add a test for this? This could very easily break in the future without a regression test.

See also
#546
And
mariocj89@cda9dc4

It seems there was a good reason to add symlink support, but since those commits also lack all tests we can't make a good judgement call right now.

@jacobtylerwalls
Copy link
Member

Closing per comment. Feel free to pursue this further and open a new PR. Thanks!

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

Successfully merging this pull request may close these issues.

Resolving symlinks considered harmful
3 participants