aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'yt_dlp/utils.py')
-rw-r--r--yt_dlp/utils.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/yt_dlp/utils.py b/yt_dlp/utils.py
index b0300b724..00721eb46 100644
--- a/yt_dlp/utils.py
+++ b/yt_dlp/utils.py
@@ -1936,7 +1936,7 @@ def intlist_to_bytes(xs):
class LockingUnsupportedError(OSError):
- msg = 'File locking is not supported on this platform'
+ msg = 'File locking is not supported'
def __init__(self):
super().__init__(self.msg)
@@ -2061,8 +2061,11 @@ class locked_file:
try:
self.f.truncate()
except OSError as e:
- if e.errno != 29: # Illegal seek, expected when self.f is a FIFO
- raise e
+ if e.errno not in (
+ errno.ESPIPE, # Illegal seek - expected for FIFO
+ errno.EINVAL, # Invalid argument - expected for /dev/null
+ ):
+ raise
return self
def unlock(self):