mirror of
https://codeberg.org/polarisfm/youtube-dl.git
synced 2024-12-24 08:42:30 +00:00
Clean up legacy code
This commit is contained in:
parent
9b14f51a3e
commit
bfa6389b74
1 changed files with 2 additions and 5 deletions
|
@ -421,11 +421,8 @@ class FileDownloader(object):
|
||||||
try:
|
try:
|
||||||
descfn = filename + u'.description'
|
descfn = filename + u'.description'
|
||||||
self.report_writedescription(descfn)
|
self.report_writedescription(descfn)
|
||||||
descfile = open(encodeFilename(descfn), 'wb')
|
with io.open(encodeFilename(descfn), 'w', encoding='utf-8') as descfile:
|
||||||
try:
|
descfile.write(info_dict['description'])
|
||||||
descfile.write(info_dict['description'].encode('utf-8'))
|
|
||||||
finally:
|
|
||||||
descfile.close()
|
|
||||||
except (OSError, IOError):
|
except (OSError, IOError):
|
||||||
self.trouble(u'ERROR: Cannot write description file ' + descfn)
|
self.trouble(u'ERROR: Cannot write description file ' + descfn)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue