瀏覽代碼

[http] Avoid closing stdout (Fixes #3686)

Sergey M․ 11 年之前
父節點
當前提交
88a23aef5a
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      youtube_dl/downloader/http.py

+ 2 - 1
youtube_dl/downloader/http.py

@@ -193,7 +193,8 @@ class HttpFD(FileDownloader):
             self.to_stderr(u"\n")
             self.report_error(u'Did not get any data blocks')
             return False
-        stream.close()
+        if tmpfilename != u'-':
+            stream.close()
         self.report_finish(data_len_str, (time.time() - start))
         if data_len is not None and byte_counter != data_len:
             raise ContentTooShortError(byte_counter, int(data_len))