1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-07-09 06:48:30 +00:00

Update _utils.py

Remove CLOCK$ as it is a valid filename in Win10. It was reserved in NT or older systems as referenced here: https://answers.microsoft.com/en-us/windows/forum/all/folder-names/2f9bb53a-da99-45e6-90f7-50d1399842aa. Testing on Win10 VM also shows that it's possible to create files/directories with it as a name.
This commit is contained in:
Alan Xiao 2025-04-25 10:03:02 -04:00 committed by GitHub
parent 8399e09e7f
commit 1d0f19614b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -168,7 +168,7 @@ def IDENTITY(x):
NUMBER_RE = r'\d+(?:\.\d+)?'
WINDOWS_RESERVED_NAMES = (
'CON', 'CONOUT$', 'CONIN$', 'PRN', 'AUX', 'CLOCK$', 'NUL',
'CON', 'CONOUT$', 'CONIN$', 'PRN', 'AUX', 'NUL',
*tuple(f'{name:s}{num:d}' for name, num in itertools.product(('COM', 'LPT'), range(10))),
*tuple(
f'{name:s}{ssd:s}'