Skip to content

Commit

Permalink
Clean up legacy code
Browse files Browse the repository at this point in the history
  • Loading branch information
phihag committed Dec 20, 2012
1 parent 9b14f51 commit bfa6389
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions youtube_dl/FileDownloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,11 +421,8 @@ def process_info(self, info_dict):
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
Expand Down

0 comments on commit bfa6389

Please sign in to comment.