1
0
Fork 0
mirror of https://github.com/blackjack4494/yt-dlc.git synced 2024-12-22 07:43:08 +00:00

Clean up legacy code

This commit is contained in:
Philipp Hagemeister 2012-12-20 13:25:54 +01:00
parent 9b14f51a3e
commit bfa6389b74

View file

@ -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