From 488f6194718cf882344d113052bc85662a638f54 Mon Sep 17 00:00:00 2001 From: Ricardo Garcia Date: Thu, 21 May 2009 20:58:31 +0200 Subject: [PATCH] Close video file before removing it. --- youtube-dl | 1 + 1 file changed, 1 insertion(+) diff --git a/youtube-dl b/youtube-dl index b2dc7952d9..ec4c9b89c6 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: