1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-04 17:34:32 +01:00

Guard against sys.getfilesystemencoding() == None (#503)

This commit is contained in:
Philipp Hagemeister 2013-01-20 01:48:05 +01:00
parent 97f194c1fb
commit 6df40dcbe0

View File

@ -409,7 +409,10 @@ def encodeFilename(s):
# match Windows 9x series as well. Besides, NT 4 is obsolete.) # match Windows 9x series as well. Besides, NT 4 is obsolete.)
return s return s
else: 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): class ExtractorError(Exception):