projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9b14f51
)
Clean up legacy code
author
Philipp Hagemeister
<phihag@phihag.de>
Thu, 20 Dec 2012 12:25:54 +0000
(13:25 +0100)
committer
Philipp Hagemeister
<phihag@phihag.de>
Thu, 20 Dec 2012 12:25:54 +0000
(13:25 +0100)
youtube_dl/FileDownloader.py
patch
|
blob
|
history
diff --git
a/youtube_dl/FileDownloader.py
b/youtube_dl/FileDownloader.py
index a7f3e106434fdcb486a8db63b7e886dd36cc1a09..a861086c3c8a70fa072100d9b83fe8a4ceec397d 100644
(file)
--- a/
youtube_dl/FileDownloader.py
+++ b/
youtube_dl/FileDownloader.py
@@
-421,11
+421,8
@@
class FileDownloader(object):
try:
descfn = filename + u'.description'
self.report_writedescription(descfn)
- descfile = open(encodeFilename(descfn), 'wb')
- try:
- descfile.write(info_dict['description'].encode('utf-8'))
- finally:
- descfile.close()
+ with io.open(encodeFilename(descfn), 'w', encoding='utf-8') as descfile:
+ descfile.write(info_dict['description'])
except (OSError, IOError):
self.trouble(u'ERROR: Cannot write description file ' + descfn)
return