diff --git a/youtube_dl/FileDownloader.py b/youtube_dl/FileDownloader.py index abc278ce5..10d32a20f 100644 --- a/youtube_dl/FileDownloader.py +++ b/youtube_dl/FileDownloader.py @@ -657,7 +657,8 @@ class FileDownloader(object): retval = subprocess.call(basic_args) # The cookie jar is not necessary anymore - os.unlink(tmp_jar_name) + if tmp_jar_name: + os.unlink(tmp_jar_name) if retval == 0: