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

os.mkdir doesn't create intermediate-level directories, causing OSError. #6

Open
MapleCCC opened this issue Jan 29, 2020 · 0 comments

Comments

@MapleCCC
Copy link

This line of code use os.mkdir to create sub-directory.

try: os.mkdir(sub_path)
except OSError as e:
  print("Could not create dir " + e.strerror)
  raise SystemExit

It prompts error on my environment because os.mkdir doesn't make all intermediate-level directories needed to contain the leaf directory, as stated in the Python official documentation. Changing to os.makedirs solves my problem.

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

No branches or pull requests

1 participant