From 70e9b6fd47ba511c6a4658efa2d3f3cc913cf813 Mon Sep 17 00:00:00 2001 From: Nick Daniels Date: Wed, 19 Dec 2012 14:20:11 +0000 Subject: [PATCH] Fix TypeError for Python 2.7.x --- youtube_dl/FileDownloader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/FileDownloader.py b/youtube_dl/FileDownloader.py index e8c62ce07..d46ee29db 100644 --- a/youtube_dl/FileDownloader.py +++ b/youtube_dl/FileDownloader.py @@ -454,7 +454,7 @@ class FileDownloader(object): self.trouble(u'ERROR: No JSON encoder found. Update to Python 2.6+, setup a json module, or leave out --write-info-json.') return try: - with io.open(encodeFilename(infofn), 'w', 'utf-8') as infof: + with io.open(encodeFilename(infofn), 'wb') as infof: json_info_dict = dict((k, v) for k,v in info_dict.items() if not k in ['urlhandle']) json.dump(json_info_dict, infof) except (OSError, IOError):