Browse Source

Close video file before removing it.

Ricardo Garcia 16 years ago
parent
commit
488f619471
1 changed files with 1 additions and 0 deletions
  1. 1 0
      youtube-dl

+ 1 - 0
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: