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

fs: introduce tree.find() #5878

Closed
wants to merge 1 commit into from

Conversation

isidentical
Copy link
Contributor

@isidentical isidentical commented Apr 26, 2021

moved to upstream branch #5879

# directories since they are represented as files. This condition
# checks whether we should yield an empty list (if it is an empty
# directory) or just yield the file itself.
if len(files) == 1 and files[0] == path and self.isdir(path_info):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This check is intentionally omitted from the bare ls() since its main objective is to support directory listing when calling walk_files() and I didn't want to repeat it in 2 different places.

def walk_files(self, path_info, **kwargs):
# Check whether directory exists
if not self.exists(path_info):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This seemed like a legacy check since none of the other implementations calls exists() before walk_files() (even the ones that doesn't raise proper errors like s3 etc, I am not sure whether it is still needed or not)

@isidentical isidentical requested a review from efiop April 26, 2021 13:34
@isidentical
Copy link
Contributor Author

🤦🏻‍♀️ pushed branch to the wrong repo

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.

1 participant