mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-27 15:16:52 +01:00
[utils] locked_file
: Ignore illegal seek on truncate
(#3610)
Closes #3557 Authored by: jakeogh
This commit is contained in:
parent
6e634cbe42
commit
131e14dc66
@ -2011,7 +2011,11 @@ def __enter__(self):
|
|||||||
self.f.close()
|
self.f.close()
|
||||||
raise
|
raise
|
||||||
if 'w' in self.mode:
|
if 'w' in self.mode:
|
||||||
|
try:
|
||||||
self.f.truncate()
|
self.f.truncate()
|
||||||
|
except OSError as e:
|
||||||
|
if e.errno != 29: # Illegal seek, expected when self.f is a FIFO
|
||||||
|
raise e
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def unlock(self):
|
def unlock(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user