[core] Decode environment variables with filesystem encoding (Fixes #3854, Fixes...
[youtube-dl] / youtube_dl / __init__.py
index 871ddead9e83ee2de91713b4b1a0828b21d96450..e73bc5c37fb6aad2322d0a26914cdfb3d9f8446a 100644 (file)
@@ -76,6 +76,9 @@ __authors__  = (
     'Aaron McDaniel (mcd1992)',
     'Magnus Kolstad',
     'Hari Padmanaban',
+    'Carlos Ramos',
+    '5moufl',
+    'lenaten',
 )
 
 __license__ = 'Public Domain'
@@ -91,6 +94,7 @@ from .options import (
     parseOpts,
 )
 from .utils import (
+    compat_expanduser,
     compat_getpass,
     compat_print,
     DateRange,
@@ -282,7 +286,7 @@ def _real_main(argv=None):
                      u' template'.format(outtmpl))
 
     any_printing = opts.geturl or opts.gettitle or opts.getid or opts.getthumbnail or opts.getdescription or opts.getfilename or opts.getformat or opts.getduration or opts.dumpjson
-    download_archive_fn = os.path.expanduser(opts.download_archive) if opts.download_archive is not None else opts.download_archive
+    download_archive_fn = compat_expanduser(opts.download_archive) if opts.download_archive is not None else opts.download_archive
 
     ydl_opts = {
         'usenetrc': opts.usenetrc,