Abort download in case of error writing file data to disk
authorRicardo Garcia <sarbalap+freshmeat@gmail.com>
Thu, 12 Aug 2010 16:41:29 +0000 (18:41 +0200)
committerRicardo Garcia <sarbalap+freshmeat@gmail.com>
Sun, 31 Oct 2010 10:28:41 +0000 (11:28 +0100)
youtube-dl

index 727fadea47dcd9dff1743e7c3ad613453dcc9452..fb231ae400d7e32cb70407395d48c940564bcf76 100755 (executable)
@@ -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