Skip to content

Conversation

@HandSonic
Copy link
Contributor

Original issue: #1949

Added test for pull #2613

The function in question assumes that ROOT is a prefix of full_path, and tries to remove it. However, it is not necessarily a prefix:

  • when ROOT is determined, both os.path.abspath() and os.path.realpath() gets called
  • when full_path is determined, only os.path.abspath() is called

This means that if the path contains a symlink, it will show up as resolved in ROOT, but not full_path, so simply removing the first X characters of full_path is not sufficient.

This PR adds an assertion to catch the bad situation early, then adds the os.path.realpath call to full_path.

  • ran the linter to address style issues (tox -e fix)
  • wrote descriptive pull request text
  • ensured there are test(s) validating the fix
  • added news fragment in docs/changelog folder
  • updated/extended the documentation

Copy link
Contributor

@gaborbernat gaborbernat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI failing.

@HandSonic
Copy link
Contributor Author

CI failing.

I checked ci. i think the reason ci fails is because the branch main ci fails before this pull. the branch main ci failure starts at #2716. When I do ci at #2714, it will pass.
https://github.com/HandSonic/virtualenv/actions/runs/9039792423

@gaborbernat
Copy link
Contributor

Be that so, however the only way I'll be able to merge this pull request is if the CI is green. Furthermore I will not have time anytime soon to work on this myself, so if you want to land this change set you will need to fix the CI either part of this request or a new one before we can land this one.

@HandSonic HandSonic closed this by deleting the head repository May 11, 2024
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