summary refs log tree commit diff
diff options
context:
space:
mode:
authorRicardo Garcia <sarbalap+freshmeat@gmail.com>2009-05-21 20:58:31 +0200
committerRicardo Garcia <sarbalap+freshmeat@gmail.com>2010-10-31 11:24:19 +0100
commit488f6194718cf882344d113052bc85662a638f54 (patch)
tree77e25c74fced552b15fabe6fd3abd1e17b78ab73
parent097ba9472b8ac3fa832d73ec0d179640db9393b7 (diff)
downloadyoutube-dl-488f6194718cf882344d113052bc85662a638f54.tar.gz
youtube-dl-488f6194718cf882344d113052bc85662a638f54.tar.xz
youtube-dl-488f6194718cf882344d113052bc85662a638f54.zip
Close video file before removing it.
-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: