From 771fb0f1d7853b2acdb39b94dccff84cac8d9cb4 Mon Sep 17 00:00:00 2001 From: Paul Bonser Date: Mon, 25 Jun 2012 15:01:57 -0500 Subject: [PATCH] handle corrupted info file, rather than crashing --- enstaller/eggcollect.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/enstaller/eggcollect.py b/enstaller/eggcollect.py index 32eceede..f9045cb4 100644 --- a/enstaller/eggcollect.py +++ b/enstaller/eggcollect.py @@ -33,7 +33,10 @@ def remove(self, egg): def info_from_metadir(meta_dir): path = join(meta_dir, '_info.json') if isfile(path): - info = json.load(open(path)) + try: + info = json.load(open(path)) + except ValueError: + return None info['installed'] = True info['meta_dir'] = meta_dir return info