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

follow_symlink=False as default in path() #140

Merged
merged 1 commit into from
Jan 22, 2024
Merged

Conversation

hagenw
Copy link
Member

@hagenw hagenw commented Jan 19, 2024

Relates to #136

Changes the default of follow_symlink in audeer.path() to False.

Also fixes handing the follow_symlink settings to audeer.path() in audeer.safe_path().

Copy link

codecov bot commented Jan 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (dc375de) 100.0% compared to head (eed8db7) 100.0%.

Additional details and impacted files
Files Coverage Δ
audeer/core/path.py 100.0% <100.0%> (ø)

@hagenw
Copy link
Member Author

hagenw commented Jan 19, 2024

All tests are passing as we don't test for symbolic links in most of them.
Looking at #136 the most critical functions seem to be:

  • audeer.md5() as this pull request will change the MD5 sum when a symbolic link is given.
  • audeer.rmdir() as this will now fail for a symbolic link instead of silentely removing it and the original file

For audeer.md5() the symbolic link will only return a different MD5 sum if the basename (under root) is different from the actual file name. So maybe it is ok to also accept this as a breaking change?

@hagenw hagenw marked this pull request as draft January 19, 2024 14:54
@frankenjoe
Copy link
Collaborator

frankenjoe commented Jan 19, 2024

To me it makes sense we call audeer.path() with follow_symlink=True in audeer.md5() and audeer.rmdir() since we are not interested in the MD5 of the symbolic link and we want to remove the directory it links to.

@hagenw hagenw marked this pull request as ready for review January 22, 2024 07:45
@hagenw
Copy link
Member Author

hagenw commented Jan 22, 2024

OK, to better keep track of the changes, I will first merge this one and then take care of audeer.rmdir() and audeer.md5() in seperate pull requests.

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