From 0edb3e336c7ebb6d52bf86eeb35fc9b44c7aba51 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Tue, 5 Apr 2022 23:08:18 +0530 Subject: 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 --- yt_dlp/downloader/common.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'yt_dlp/downloader/common.py') diff --git a/yt_dlp/downloader/common.py b/yt_dlp/downloader/common.py index afd2f2e38..cbfea7a65 100644 --- a/yt_dlp/downloader/common.py +++ b/yt_dlp/downloader/common.py @@ -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): -- cgit v1.2.3