3 ms·
You seem to be getting downvoted for being too vague, so I will post the solution: The snippet breaks for paths starting with a minus, as mkdir will interpret
by ynik 5y ago
You seem to be getting downvoted for being too vague, so I will post the solution:
The snippet breaks for paths starting with a minus, as mkdir will interpret those as another option.
The solution is:
subprocess.run(["mkdir", "-p", "--", path])