Do not prevent download if locking is unsupported
Closes #3022 Failure to lock download-archive is still fatal. This is consistent with youtube-dl's behavior
This commit is contained in:
parent
ce0593ef61
commit
0edb3e336c
2 changed files with 52 additions and 45 deletions
|
|
@ -11,6 +11,7 @@ from ..utils import (
|
|||
encodeFilename,
|
||||
error_to_compat_str,
|
||||
format_bytes,
|
||||
LockingUnsupportedError,
|
||||
sanitize_open,
|
||||
shell_quote,
|
||||
timeconvert,
|
||||
|
|
@ -234,7 +235,10 @@ class FileDownloader(object):
|
|||
|
||||
@wrap_file_access('open', fatal=True)
|
||||
def sanitize_open(self, filename, open_mode):
|
||||
return sanitize_open(filename, open_mode)
|
||||
f, filename = sanitize_open(filename, open_mode)
|
||||
if not getattr(f, 'locked', None):
|
||||
self.write_debug(f'{LockingUnsupportedError.msg}. Proceeding without locking', only_once=True)
|
||||
return f, filename
|
||||
|
||||
@wrap_file_access('remove')
|
||||
def try_remove(self, filename):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue