aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xyoutube-dl1
1 files changed, 1 insertions, 0 deletions
diff --git a/youtube-dl b/youtube-dl
index b2dc7952d..ec4c9b89c 100755
--- a/youtube-dl
+++ b/youtube-dl
@@ -286,6 +286,7 @@ class FileDownloader(object):
self._do_download(outstream, info_dict['url'])
outstream.close()
except (OSError, IOError), err:
+ outstream.close()
os.remove(filename)
raise UnavailableFormatError
except (urllib2.URLError, httplib.HTTPException, socket.error), err: