youtube-dl

Another place where youtube-dl lives on
git clone git://git.oshgnacknak.de/youtube-dl.git
Log | Files | Refs | README | LICENSE

commit bfa6389b74866d5406f68a06c589193b12f83c38
parent 9b14f51a3eaf5b63dad288e092d8a083dd931ceb
Author: Philipp Hagemeister <phihag@phihag.de>
Date:   Thu, 20 Dec 2012 13:25:54 +0100

Clean up legacy code

Diffstat:
Myoutube_dl/FileDownloader.py | 7++-----
1 file changed, 2 insertions(+), 5 deletions(-)

diff --git 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