Browse Source

Do not decode None

Philipp Hagemeister 12 years ago
parent
commit
0be41ec241
1 changed files with 2 additions and 1 deletions
  1. 2 1
      youtube_dl/__init__.py

+ 2 - 1
youtube_dl/__init__.py

@@ -506,7 +506,8 @@ def _real_main():
 
 
     if sys.version_info < (3,):
     if sys.version_info < (3,):
         # In Python 2, sys.argv is a bytestring (also note http://bugs.python.org/issue2128 for Windows systems)
         # In Python 2, sys.argv is a bytestring (also note http://bugs.python.org/issue2128 for Windows systems)
-        opts.outtmpl = opts.outtmpl.decode(preferredencoding())
+        if opts.outtmpl is not None:
+            opts.outtmpl = opts.outtmpl.decode(preferredencoding())
     outtmpl =((opts.outtmpl is not None and opts.outtmpl)
     outtmpl =((opts.outtmpl is not None and opts.outtmpl)
             or (opts.format == '-1' and opts.usetitle and u'%(title)s-%(id)s-%(format)s.%(ext)s')
             or (opts.format == '-1' and opts.usetitle and u'%(title)s-%(id)s-%(format)s.%(ext)s')
             or (opts.format == '-1' and u'%(id)s-%(format)s.%(ext)s')
             or (opts.format == '-1' and u'%(id)s-%(format)s.%(ext)s')