aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/utils.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2022-06-03 21:29:03 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2022-06-03 21:45:35 +0530
commit1890fc6389393ffaa05fa27bd47717f4d862404f (patch)
treeeccbba9c05ba3032d217948ba93e529ca764f7af /yt_dlp/utils.py
parentc4910024f3dbb9798554f02d935d0b0604f51182 (diff)
downloadhypervideo-pre-1890fc6389393ffaa05fa27bd47717f4d862404f.tar.lz
hypervideo-pre-1890fc6389393ffaa05fa27bd47717f4d862404f.tar.xz
hypervideo-pre-1890fc6389393ffaa05fa27bd47717f4d862404f.zip
[cleanup] Misc fixes
Cherry-picks from: #3498, #3947 Related: #3949, https://github.com/yt-dlp/yt-dlp/issues/1839#issuecomment-1140313836 Authored by: pukkandan, flashdagger, gamer191
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):