From 37e325b92ff9d784715ac0e5d1f7d96bf5f45ad9 Mon Sep 17 00:00:00 2001 From: Simon Sawicki Date: Wed, 25 Jan 2023 22:32:07 +0100 Subject: [PATCH] [utils] Use local kernel32 for file locking on Windows Ref: https://github.com/ytdl-org/youtube-dl/issues/21545 Authored by: Grub4K --- yt_dlp/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yt_dlp/utils.py b/yt_dlp/utils.py index 15e1f97cb..458239a12 100644 --- a/yt_dlp/utils.py +++ b/yt_dlp/utils.py @@ -2106,7 +2106,7 @@ if sys.platform == 'win32': ('hEvent', ctypes.wintypes.HANDLE), ] - kernel32 = ctypes.windll.kernel32 + kernel32 = ctypes.WinDLL('kernel32') LockFileEx = kernel32.LockFileEx LockFileEx.argtypes = [ ctypes.wintypes.HANDLE, # hFile