Abort download in case of error writing file data to disk

pull/2/head
Ricardo Garcia 15 years ago
parent 38ed13444a
commit d67e097462

@ -594,7 +594,8 @@ class FileDownloader(object):
try: try:
stream.write(data_block) stream.write(data_block)
except (IOError, OSError), err: 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) block_size = self.best_block_size(after - before, data_block_len)
# Progress message # Progress message

Loading…
Cancel
Save