Blame 0001-Fix-traceback-on-corrupt-zipfile.patch
|
|
10065c4 |
From 80e8bf4344417f55510bc6f8ee29af7014b024ca Mon Sep 17 00:00:00 2001
|
|
|
01b45a6 |
From: Mikolaj Izdebski <mizdebsk@redhat.com>
|
|
|
01b45a6 |
Date: Wed, 16 Aug 2017 15:20:29 +0200
|
|
|
10065c4 |
Subject: [PATCH 1/2] Fix traceback on corrupt zipfile
|
|
|
01b45a6 |
|
|
|
01b45a6 |
Resolves: rhbz#1481005
|
|
|
01b45a6 |
---
|
|
|
01b45a6 |
python/javapackages/common/manifest.py | 4 ++--
|
|
|
01b45a6 |
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
01b45a6 |
|
|
|
01b45a6 |
diff --git a/python/javapackages/common/manifest.py b/python/javapackages/common/manifest.py
|
|
|
10065c4 |
index 9a27ff8..5a6245b 100644
|
|
|
01b45a6 |
--- a/python/javapackages/common/manifest.py
|
|
|
01b45a6 |
+++ b/python/javapackages/common/manifest.py
|
|
|
01b45a6 |
@@ -33,7 +33,7 @@
|
|
|
01b45a6 |
# Michal Srb <msrb@redhat.com>
|
|
|
01b45a6 |
|
|
|
01b45a6 |
import zipfile
|
|
|
01b45a6 |
-from zipfile import ZipFile
|
|
|
01b45a6 |
+from zipfile import ZipFile, BadZipfile
|
|
|
01b45a6 |
from javapackages.common.exception import JavaPackagesToolsException
|
|
|
01b45a6 |
|
|
|
01b45a6 |
|
|
|
01b45a6 |
@@ -61,7 +61,7 @@ class Manifest(object):
|
|
|
01b45a6 |
jarfile = ZipFile(self._path)
|
|
|
01b45a6 |
if "META-INF/MANIFEST.MF" in jarfile.namelist():
|
|
|
01b45a6 |
mf = jarfile.open("META-INF/MANIFEST.MF", "r")
|
|
|
01b45a6 |
- except IOError:
|
|
|
01b45a6 |
+ except (IOError, BadZipfile):
|
|
|
01b45a6 |
pass
|
|
|
01b45a6 |
if mf is None:
|
|
|
01b45a6 |
return None
|
|
|
01b45a6 |
--
|
|
|
10065c4 |
2.17.0
|
|
|
01b45a6 |
|