about summary refs log tree commit diff
path: root/youtube_dl/downloader/http.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2014-09-05 22:05:36 +0700
committerSergey M․ <dstftw@gmail.com>2014-09-05 22:05:36 +0700
commit88a23aef5a7d64ab4f4d682d6b336ac9eea2efba (patch)
tree0e501cba4a955490fa20e22ae15b14b32604a440 /youtube_dl/downloader/http.py
parent140d8d77b307fe1e13e54f56c11b3441d9b4d0c1 (diff)
downloadyoutube-dl-88a23aef5a7d64ab4f4d682d6b336ac9eea2efba.tar.gz
youtube-dl-88a23aef5a7d64ab4f4d682d6b336ac9eea2efba.tar.xz
youtube-dl-88a23aef5a7d64ab4f4d682d6b336ac9eea2efba.zip
[http] Avoid closing stdout (Fixes #3686)
Diffstat (limited to 'youtube_dl/downloader/http.py')
-rw-r--r--youtube_dl/downloader/http.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/youtube_dl/downloader/http.py b/youtube_dl/downloader/http.py
index d01d1897e..6caf7451e 100644
--- a/youtube_dl/downloader/http.py
+++ b/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))