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

[Bug] Using list to create folder is not correct. #301

Open
Mai0313 opened this issue Sep 2, 2024 · 0 comments
Open

[Bug] Using list to create folder is not correct. #301

Mai0313 opened this issue Sep 2, 2024 · 0 comments

Comments

@Mai0313
Copy link

Mai0313 commented Sep 2, 2024

The output after .split from L490 will be list[str] without any doubt, so L491 is kind of reasonable for me since you use last string of the list to create the dir.

However, L492 is using a list to create the dir, which is not even making any sense.

tbh, we can just makedirs by using output_dir_path

For example, it used to be

splits = output_dir_path.split("/")
os.makedirs("/".join(splits[:-1]),exist_ok=True)
os.makedirs("/".join(splits),exist_ok=True)

But we do not even need to split it to create dir, we can just do this below

os.makedirs(output_dir_path, exist_ok=True)

No matter how many folders you want, it will create dir recursively

@Mai0313 Mai0313 changed the title [Bug] Using list to create dir???? [Bug] Using list to create folder is not correct. Sep 2, 2024
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 a pull request may close this issue.

1 participant