1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-10-04 19:44:33 -04:00

[utils] locked_file: Ignore illegal seek on truncate (#3610)

Closes #3557

Authored by: jakeogh
This commit is contained in:
Justin Keogh
2022-05-01 20:31:06 +00:00
committed by GitHub
parent 6e634cbe42
commit 131e14dc66

View File

@@ -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):