1
0
mirror of https://github.com/yt-dlp/yt-dlp synced 2025-07-04 04:52:52 -05:00

[test] Add test_locked_file

This commit is contained in:
pukkandan
2022-04-07 11:30:46 +05:30
parent b63837bce0
commit b506289fe2
2 changed files with 34 additions and 2 deletions

View File

@ -684,8 +684,9 @@ def sanitize_open(filename, open_mode):
try:
try:
if sys.platform == 'win32':
# FIXME: Windows only has mandatory locking which also locks the file from being read.
# So for now, don't lock the file on windows. Ref: https://github.com/yt-dlp/yt-dlp/issues/3124
# FIXME: An exclusive lock also locks the file from being read.
# Since windows locks are mandatory, don't lock the file on windows (for now).
# Ref: https://github.com/yt-dlp/yt-dlp/issues/3124
raise LockingUnsupportedError()
stream = locked_file(filename, open_mode, block=False).__enter__()
except LockingUnsupportedError: