various py3 fixes; all tests green on 3.3
[youtube-dl] / youtube_dl / FileDownloader.py
index b43acd19b42a1b7ad8b4c8329657864b35b365b3..61d3654e20d63f58cfb10d38695312d18d5766d5 100644 (file)
@@ -453,9 +453,9 @@ 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:
-                infof = open(encodeFilename(infofn), 'wb')
+                infof = open(encodeFilename(infofn), 'w')
                 try:
-                    json_info_dict = dict((k,v) for k,v in info_dict.iteritems() if not k in ('urlhandle',))
+                    json_info_dict = dict((k, info_dict[k]) for k in info_dict if not k in ['urlhandle'])
                     json.dump(json_info_dict, infof)
                 finally:
                     infof.close()