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

Switch to using lstat() instead of stat() to not match symlink targets #13161

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

roubert
Copy link

@roubert roubert commented Jan 12, 2025

As requested by @pfmoore for issue #13156.

@pfmoore
Copy link
Member

pfmoore commented Jan 12, 2025

See #13156 (comment) - I think the existing code should work without this change, and we need to understand why it doesn't before trying to "fix" the issue.

The convenience function samefile() calls stat() and samestat(), but
this leads to treating a symlink and its target as the same which is
unlikely to be intentional here as that doesn't work well with venv.
@roubert roubert force-pushed the running_under_virtualenv branch from ed0b04b to f6e5730 Compare January 13, 2025 18:49
@pfmoore
Copy link
Member

pfmoore commented Jan 13, 2025

I'll leave this for someone familiar with Unix to comment on whether it's a good fix. It seems reasonable to me.

@roubert roubert changed the title Always use the full executable name when running under virtualenv Switch to using lstat() instead of stat() to not match symlink targets Jan 13, 2025
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.

2 participants