浏览代码

[YoutubeDL] Ignore failure to create existing directory (#27811)

Aaron Zeng 4 年之前
父节点
当前提交
8e5477d036
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      youtube_dl/YoutubeDL.py

+ 2 - 0
youtube_dl/YoutubeDL.py

@@ -1779,6 +1779,8 @@ class YoutubeDL(object):
                     os.makedirs(dn)
                 return True
             except (OSError, IOError) as err:
+                if isinstance(err, OSError) and err.errno == errno.EEXIST:
+                    return True
                 self.report_error('unable to create directory ' + error_to_compat_str(err))
                 return False