From: Ricardo Garcia Date: Thu, 21 May 2009 18:58:31 +0000 (+0200) Subject: Close video file before removing it. X-Git-Url: http://git.oshgnacknak.de/?a=commitdiff_plain;h=488f6194718cf882344d113052bc85662a638f54;p=youtube-dl Close video file before removing it. --- 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: