diff options
author | Alex Ionescu <aaionescu@protonmail.com> | 2023-02-17 04:29:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-17 08:59:32 +0530 |
commit | b25d6cb96337d479bdcb41768356da414c3aa835 (patch) | |
tree | f613c476785a488784ac8d3e20436304929f585e /yt_dlp/utils.py | |
parent | 361630015535026712bdb67f804a15b65ff9ee7e (diff) | |
download | hypervideo-pre-b25d6cb96337d479bdcb41768356da414c3aa835.tar.lz hypervideo-pre-b25d6cb96337d479bdcb41768356da414c3aa835.tar.xz hypervideo-pre-b25d6cb96337d479bdcb41768356da414c3aa835.zip |
[utils] Fix race condition in `make_dir` (#6089)
Authored by: aionescu
Diffstat (limited to 'yt_dlp/utils.py')
-rw-r--r-- | yt_dlp/utils.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/yt_dlp/utils.py b/yt_dlp/utils.py index 2d9e61c5b..736468aef 100644 --- a/yt_dlp/utils.py +++ b/yt_dlp/utils.py @@ -5370,8 +5370,8 @@ def random_uuidv4(): def make_dir(path, to_screen=None): try: dn = os.path.dirname(path) - if dn and not os.path.exists(dn): - os.makedirs(dn) + if dn: + os.makedirs(dn, exist_ok=True) return True except OSError as err: if callable(to_screen) is not None: |