aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/utils.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2022-04-05 23:15:17 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2022-04-05 23:32:22 +0530
commit897376719871279eef89426b1452abb89051f0dc (patch)
treeb0c9a882461b9f819fc48518685853d871742b4d /yt_dlp/utils.py
parent0edb3e336c7ebb6d52bf86eeb35fc9b44c7aba51 (diff)
downloadhypervideo-pre-897376719871279eef89426b1452abb89051f0dc.tar.lz
hypervideo-pre-897376719871279eef89426b1452abb89051f0dc.tar.xz
hypervideo-pre-897376719871279eef89426b1452abb89051f0dc.zip
Do not lock downloading file on Windows
Closes #3124
Diffstat (limited to 'yt_dlp/utils.py')
-rw-r--r--yt_dlp/utils.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/yt_dlp/utils.py b/yt_dlp/utils.py
index 2db22d676..87dd04e23 100644
--- a/yt_dlp/utils.py
+++ b/yt_dlp/utils.py
@@ -683,6 +683,10 @@ def sanitize_open(filename, open_mode):
for attempt in range(2):
try:
try:
+ if sys.platform == 'win32':
+ # FIXME: Windows only has mandatory locking which also locks the file from being read.
+ # So for now, don't lock the file on windows. Ref: https://github.com/yt-dlp/yt-dlp/issues/3124
+ raise LockingUnsupportedError()
stream = locked_file(filename, open_mode, block=False).__enter__()
except LockingUnsupportedError:
stream = open(filename, open_mode)