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

IndexFile._to_relative_path - fix case where absolute path gets stripped of trailing slash #2012

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

Conversation

kamilkozik7
Copy link

@kamilkozik7 kamilkozik7 commented Mar 7, 2025

I encountered this issue on MacOS, python 3.7 and later

Added fix and appropriate unit test.

Stripping of trailing slash seems to be happening in os.path.relpath, altough I am not sure whether that is expected behaviour. In case it is not expected, and ever gets fixed, I added an additional check ( and not result.endswith(os.sep)) to make sure that the trailing slash doesn't get duplicated.

@kamilkozik7 kamilkozik7 force-pushed the fix-trailing-slash branch 2 times, most recently from ffad5ac to 2bbb6ee Compare March 7, 2025 17:45
@kamilkozik7 kamilkozik7 marked this pull request as ready for review March 7, 2025 18:07
Copy link

@kelibezhani kelibezhani left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants