Ticket #1876: 0001-1876-Failure-to-cleanup-temporary-files-after-filesy.patch

File 0001-1876-Failure-to-cleanup-temporary-files-after-filesy.patch, 1.2 KB (added by mtd, 14 years ago)
  • src/sugar/bundle/bundle.py

    From 3fd062f4f4114436213ca2759638a60e5463f605 Mon Sep 17 00:00:00 2001
    From: Martin Dengler <martin@martindengler.com>
    Date: Tue, 10 Aug 2010 09:32:02 +0100
    Subject: [PATCH] #1876 Failure to cleanup temporary files after filesystem full errors
    
    More gracefully handle large zip files or malformed bundle errors; not
    a fix to the underlying issue.
    ---
     src/sugar/bundle/bundle.py |    7 ++++++-
     1 files changed, 6 insertions(+), 1 deletions(-)
    
    diff --git a/src/sugar/bundle/bundle.py b/src/sugar/bundle/bundle.py
    index cb110cc..8fb4f79 100644
    a b class Bundle(object): 
    7171        self._zip_file = None
    7272
    7373        if not os.path.isdir(self._path):
    74             self._zip_file = zipfile.ZipFile(self._path)
     74            try:
     75                self._zip_file = zipfile.ZipFile(self._path)
     76            except (zipfile.error, zipfile.LargeZipFile), ziperror:
     77                raise MalformedBundleException(
     78                    "Error accessing zip file %s: %s"
     79                    % (self._path, ziperror))
    7580            self._check_zip_bundle()
    7681
    7782        # manifest = self._get_file(self._infodir + '/contents')