浏览代码

Abort download in case of error writing file data to disk

Ricardo Garcia 15 年之前
父节点
当前提交
d67e097462
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      youtube-dl

+ 2 - 1
youtube-dl

@@ -594,7 +594,8 @@ class FileDownloader(object):
 			try:
 				stream.write(data_block)
 			except (IOError, OSError), err:
-				self.trouble('\nERROR: unable to write data: %s' % str(err))
+				self.trouble(u'\nERROR: unable to write data: %s' % str(err))
+				return False
 			block_size = self.best_block_size(after - before, data_block_len)
 
 			# Progress message