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

fix: _stat_mode can follow symlinks pointing to a relative path #113

Merged
merged 1 commit into from
Jul 16, 2024

Conversation

khsrali
Copy link
Contributor

@khsrali khsrali commented Jul 2, 2024

_stat_mode couldn't follow symlinks that are pointing to relative paths. As a result, _stat_mode of the symlink was returned instead of the target.

This PR adds an extra check if the target path of a symlink is a relative path; it resolves it.

In addition, a new function relpath is added for the sake of completeness. This will prevent users to manually transforming each FcPath to Path in order to get the relative path.

Copy link
Collaborator

@ekouts ekouts left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the contributions @khsrali ! I was going to approve, but just noticed that the type check fails, would you have time to take a look to that? :)

The truth is I haven't been maintaining very well FcPath even though it is probably interesting to other users as well! No need to do it in this PR, but if it some point you would have some time to add some documentation in rtd it could help me and others :)

@khsrali
Copy link
Contributor Author

khsrali commented Jul 11, 2024

Hi @ekouts ,
Thanks, I'll fix it by tomorrow the latest.

The truth is I haven't been maintaining very well FcPath even though it is probably interesting to other users as well! No need to do it in this PR, but if it some point you would have some time to add some documentation in rtd it could help me and others :)

Absolutely, you are right, it's good to have some documentation. Will do in a separate PR :)

@ekouts
Copy link
Collaborator

ekouts commented Jul 11, 2024

Great, thanks!

@ekouts ekouts merged commit 6cae414 into eth-cscs:main Jul 16, 2024
8 checks passed
@khsrali khsrali deleted the _stat_mod branch July 16, 2024 09:59
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