From 131e14dc6650feea26ec814e6964e9d3e94ac881 Mon Sep 17 00:00:00 2001 From: Justin Keogh Date: Sun, 1 May 2022 20:31:06 +0000 Subject: [PATCH] [utils] `locked_file`: Ignore illegal seek on `truncate` (#3610) Closes #3557 Authored by: jakeogh --- yt_dlp/utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/yt_dlp/utils.py b/yt_dlp/utils.py index 0b28b0926..e25a112d3 100644 --- a/yt_dlp/utils.py +++ b/yt_dlp/utils.py @@ -2011,7 +2011,11 @@ class locked_file: self.f.close() raise if 'w' in self.mode: - self.f.truncate() + try: + self.f.truncate() + except OSError as e: + if e.errno != 29: # Illegal seek, expected when self.f is a FIFO + raise e return self def unlock(self):