Fix filename sanitization with --no-windows-filenames (#11988)
Some checks failed
Download Tests / Full Download Tests (windows-latest, 3.9) (push) Waiting to run
Download Tests / Full Download Tests (windows-latest, pypy-3.10) (push) Waiting to run
CodeQL / Analyze (python) (push) Failing after 1m0s
Core Tests / Core Tests (ubuntu-latest, 3.10) (push) Successful in 4m37s
Core Tests / Core Tests (ubuntu-latest, 3.11) (push) Failing after 15m20s
Core Tests / Core Tests (ubuntu-latest, 3.12) (push) Failing after 16m1s
Core Tests / Core Tests (ubuntu-latest, 3.13) (push) Failing after 15m44s
Core Tests / Core Tests (ubuntu-latest, pypy-3.10) (push) Successful in 11m11s
Download Tests / Quick Download Tests (push) Has been skipped
Download Tests / Full Download Tests (ubuntu-latest, 3.10) (push) Has been skipped
Download Tests / Full Download Tests (ubuntu-latest, 3.11) (push) Has been skipped
Download Tests / Full Download Tests (ubuntu-latest, 3.12) (push) Has been skipped
Download Tests / Full Download Tests (ubuntu-latest, 3.13) (push) Has been skipped
Download Tests / Full Download Tests (ubuntu-latest, pypy-3.10) (push) Has been skipped
Quick Test / Core Test (push) Successful in 2m52s
Quick Test / Code check (push) Successful in 1m22s
Release (master) / release (push) Has been skipped
Release (master) / publish_pypi (push) Has been skipped
Core Tests / Core Tests (windows-latest, 3.10) (push) Has been cancelled
Core Tests / Core Tests (windows-latest, 3.12) (push) Has been cancelled
Core Tests / Core Tests (windows-latest, 3.13) (push) Has been cancelled
Core Tests / Core Tests (windows-latest, 3.9) (push) Has been cancelled
Core Tests / Core Tests (windows-latest, pypy-3.10) (push) Has been cancelled

Fix bug in 6fc85f617a

Closes #11987
Authored by: bashonly
This commit is contained in:
bashonly 2025-01-11 13:05:23 -06:00 committed by GitHub
parent 1f4e1e85a2
commit 8346b54915
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1323,7 +1323,7 @@ class YoutubeDL:
elif (sys.platform != 'win32' and not self.params.get('restrictfilenames')
and self.params.get('windowsfilenames') is False):
def sanitize(key, value):
return value.replace('/', '\u29F8').replace('\0', '')
return str(value).replace('/', '\u29F8').replace('\0', '')
else:
def sanitize(key, value):
return filename_sanitizer(key, value, restricted=self.params.get('restrictfilenames'))