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 read hide files bug for reader bug #174

Merged
merged 7 commits into from
Aug 21, 2020

Conversation

vslyu
Copy link
Contributor

@vslyu vslyu commented Aug 14, 2020

add a recursive function for avoiding reading hidden files in readers

@fuyinno4 fuyinno4 self-requested a review August 18, 2020 04:43
fuyinno4
fuyinno4 previously approved these changes Aug 18, 2020
# use files and dirs
for file_name in files:
file_list.append(os.path.join(train_data_path, file_name))
print(os.path.join(train_data_path, file_name))
Copy link
Collaborator

Choose a reason for hiding this comment

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

  1. 为什么要print
  2. 上次说的, 如果有包含隐藏文件,要打个warning, 也没打.

for x in os.listdir(train_data_path)
]
# file_list = [
# os.path.join(train_data_path, x)
Copy link
Collaborator

Choose a reason for hiding this comment

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

无用注释删除

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, done

for file_name in files:
file_list.append(os.path.join(train_data_path, file_name))
print(os.path.join(train_data_path, file_name))
for dirs_name in dirs:
Copy link
Collaborator

Choose a reason for hiding this comment

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

同上

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, done

dirs[:] = [d for d in dirs if not d[0] == '.']
if (files == None and dirs == None):
return None
else:
Copy link
Collaborator

Choose a reason for hiding this comment

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

同样的代码, 为什么写了3遍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, move this function to util.py

@fuyinno4 fuyinno4 merged commit af7c0e7 into PaddlePaddle:master Aug 21, 2020
wangzhen38 pushed a commit to wangzhen38/PaddleRec that referenced this pull request Aug 6, 2021
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.

None yet

3 participants