Skip to content

A feature-rich command-line audio/video downloader

[utils] Use flock instead of lockf (Fixes #3621)

Philipp Hagemeister2582bebe06cf
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index 8a36e619ae..6fe0572348 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -1141,10 +1141,10 @@ else:
import fcntl
def _lock_file(f, exclusive):
- fcntl.lockf(f, fcntl.LOCK_EX if exclusive else fcntl.LOCK_SH)
+ fcntl.flock(f, fcntl.LOCK_EX if exclusive else fcntl.LOCK_SH)
def _unlock_file(f):
- fcntl.lockf(f, fcntl.LOCK_UN)
+ fcntl.flock(f, fcntl.LOCK_UN)
class locked_file(object):