projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
97f194c
)
Guard against sys.getfilesystemencoding() == None (#503)
author
Philipp Hagemeister
<phihag@phihag.de>
Sun, 20 Jan 2013 00:48:05 +0000
(
01:48
+0100)
committer
Philipp Hagemeister
<phihag@phihag.de>
Sun, 20 Jan 2013 00:48:05 +0000
(
01:48
+0100)
youtube_dl/utils.py
patch
|
blob
|
history
diff --git
a/youtube_dl/utils.py
b/youtube_dl/utils.py
index 51c5ad9204d319de00cbbd7458d22cbdb1172cc5..532e8c7825066ef822506a7589f9d3f48163f1f8 100644
(file)
--- a/
youtube_dl/utils.py
+++ b/
youtube_dl/utils.py
@@
-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):