]> git.bitcoin.ninja Git - youtube-dl/blobdiff - youtube_dl/FileDownloader.py
Remove mentions of unicode
[youtube-dl] / youtube_dl / FileDownloader.py
index d7d5b1521ec72ea46782064f3c6fadd3d5032cb7..777a525455718a1449ea1aaf838c595d860abc75 100644 (file)
@@ -330,7 +330,7 @@ class FileDownloader(object):
                        template_dict['epoch'] = int(time.time())
                        template_dict['autonumber'] = u'%05d' % self._num_downloads
 
-                       template_dict = dict((k, sanitize_filename(compat_str(v), self.params.get('restrictfilenames'))) for k,v in template_dict.items())
+                       template_dict = dict((k, sanitize_filename(u(v), self.params.get('restrictfilenames'))) for k,v in template_dict.items())
                        filename = self.params['outtmpl'] % template_dict
                        return filename
                except (ValueError, KeyError), err:
@@ -397,7 +397,7 @@ class FileDownloader(object):
                        if dn != '' and not os.path.exists(dn): # dn is already encoded
                                os.makedirs(dn)
                except (OSError, IOError), err:
-                       self.trouble(u'ERROR: unable to create directory ' + unicode(err))
+                       self.trouble(u'ERROR: unable to create directory ' + u(err))
                        return
 
                if self.params.get('writedescription', False):