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

Add follow_symlink argument to rmdir() #141

Merged
merged 2 commits into from
Jan 22, 2024
Merged

Conversation

hagenw
Copy link
Member

@hagenw hagenw commented Jan 22, 2024

This adds the follow_symlink argument to audeer.rmdir(), but sets it to True as default as this is avoids breaking changes and seems to be a meaningful behavior.
I decided against silently setting it to True internally as we still use audeer.rmdir() in loops that can get a speed up by ensuring that we don't have a symbolic link before we call audeer.rmdir(), e.g. https://github.com/audeering/audb/blob/12ad8520e45c11f152c5c96b11f221e3a1fb40f2/audb/core/load_to.py#L303-L329

I also added tests and included a new error under Raises section in the docstring that can happen with follow_symlink=False.

image

Copy link

codecov bot commented Jan 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e6c534e) 100.0% compared to head (0b6e179) 100.0%.

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

@hagenw hagenw requested a review from frankenjoe January 22, 2024 08:51
@frankenjoe frankenjoe merged commit 2ec395a into main Jan 22, 2024
@frankenjoe frankenjoe deleted the rmdir-follow-symlink branch January 22, 2024 09:18
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