mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-25 02:45:12 +00:00
Guard against sys.getfilesystemencoding() == None (#503)
This commit is contained in:
parent
97f194c1fb
commit
6df40dcbe0
1 changed files with 4 additions and 1 deletions
|
@ -409,7 +409,10 @@ def encodeFilename(s):
|
|||
# match Windows 9x series as well. Besides, NT 4 is obsolete.)
|
||||
return s
|
||||
else:
|
||||
return s.encode(sys.getfilesystemencoding(), 'ignore')
|
||||
encoding = sys.getfilesystemencoding()
|
||||
if encoding is None:
|
||||
encoding = 'utf-8'
|
||||
return s.encode(encoding, 'ignore')
|
||||
|
||||
|
||||
class ExtractorError(Exception):
|
||||
|
|
Loading…
Reference in a new issue