summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-01-24 03:36:35 +0000
committerZac Medico <zmedico@gentoo.org>2010-01-24 03:36:35 +0000
commit1e831b40d5130bce96a6243e80836f5d373f1527 (patch)
tree994625eaf27db72d30c12ff719dd48f5b320eea1
parent424465b92f4b351489e3624352494e72c0f1a873 (diff)
downloadportage-1e831b40d5130bce96a6243e80836f5d373f1527.tar.gz
portage-1e831b40d5130bce96a6243e80836f5d373f1527.tar.bz2
portage-1e831b40d5130bce96a6243e80836f5d373f1527.zip
Bug #301926 - Handle ValueError in parseManifest2(), triggered by corrupt
manifest entry. svn path=/main/trunk/; revision=15207
-rw-r--r--pym/portage/manifest.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pym/portage/manifest.py b/pym/portage/manifest.py
index 40a8d77b6..fc8afb4cf 100644
--- a/pym/portage/manifest.py
+++ b/pym/portage/manifest.py
@@ -59,7 +59,10 @@ def parseManifest2(mysplit):
if len(mysplit) > 4 and mysplit[0] in portage.const.MANIFEST2_IDENTIFIERS:
mytype = mysplit[0]
myname = mysplit[1]
- mysize = int(mysplit[2])
+ try:
+ mysize = int(mysplit[2])
+ except ValueError:
+ return None
myhashes = dict(zip(mysplit[3::2], mysplit[4::2]))
myhashes["size"] = mysize
myentry = Manifest2Entry(type=mytype, name=myname, hashes=myhashes)