1
0
mirror of https://github.com/l1ving/youtube-dl synced 2026-06-08 10:23:36 +08:00

Fix TypeError for Python 2.7.x

This commit is contained in:
Nick Daniels
2012-12-19 14:20:11 +00:00
Unverified
parent cdb3076445
commit 70e9b6fd47
+1 -1
View File
@@ -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):