1 |
Author: zmedico |
2 |
Date: 2010-01-29 18:50:06 +0000 (Fri, 29 Jan 2010) |
3 |
New Revision: 15259 |
4 |
|
5 |
Modified: |
6 |
main/branches/2.1.7/pym/portage/manifest.py |
7 |
Log: |
8 |
Bug #301926 - Handle ValueError in parseManifest2(), triggered by corrupt |
9 |
manifest entry. (trunk r15207) |
10 |
|
11 |
Modified: main/branches/2.1.7/pym/portage/manifest.py |
12 |
=================================================================== |
13 |
--- main/branches/2.1.7/pym/portage/manifest.py 2010-01-29 18:49:58 UTC (rev 15258) |
14 |
+++ main/branches/2.1.7/pym/portage/manifest.py 2010-01-29 18:50:06 UTC (rev 15259) |
15 |
@@ -59,7 +59,10 @@ |
16 |
if len(mysplit) > 4 and mysplit[0] in portage.const.MANIFEST2_IDENTIFIERS: |
17 |
mytype = mysplit[0] |
18 |
myname = mysplit[1] |
19 |
- mysize = int(mysplit[2]) |
20 |
+ try: |
21 |
+ mysize = int(mysplit[2]) |
22 |
+ except ValueError: |
23 |
+ return None |
24 |
myhashes = dict(zip(mysplit[3::2], mysplit[4::2])) |
25 |
myhashes["size"] = mysize |
26 |
myentry = Manifest2Entry(type=mytype, name=myname, hashes=myhashes) |