Skip to content

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

@MapleCCC

Description

@MapleCCC

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions