From df8af0ec4a601aef8e6150138f207f316359a4f1 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 2 Feb 2012 16:45:32 +0100 Subject: [PATCH] [FIX] in load_information_from_description_file, f can be a StringIO (in case of zipped module) and StringIO are not contextmanagers. So rollback the context management thingie bzr revid: xmo@openerp.com-20120202154532-tq9x07ujf0bn9mcp --- openerp/modules/module.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/openerp/modules/module.py b/openerp/modules/module.py index c2935c8d117..bc065f22b90 100644 --- a/openerp/modules/module.py +++ b/openerp/modules/module.py @@ -332,7 +332,6 @@ def load_information_from_description_file(module): 'description': '', 'icon': get_module_icon(module), 'installable': True, - 'auto_install': False, 'license': 'AGPL-3', 'name': False, 'post_load': None, @@ -345,8 +344,11 @@ def load_information_from_description_file(module): 'depends data demo test init_xml update_xml demo_xml'.split(), iter(list, None))) - with tools.file_open(terp_file) as terp_f: - info.update(eval(terp_f.read())) + f = tools.file_open(terp_file) + try: + info.update(eval(f.read())) + finally: + f.close() if 'active' in info: # 'active' has been renamed 'auto_install'