diff --git a/bin/service/netrpc_server.py b/bin/service/netrpc_server.py index 7f204751576..fcd6657bdc9 100644 --- a/bin/service/netrpc_server.py +++ b/bin/service/netrpc_server.py @@ -48,7 +48,8 @@ class TinySocketClientThread(threading.Thread, netsvc.OpenERPDispatcher): try: self.socket.shutdown( getattr(socket, 'SHUT_RDWR', 2)) - except Exception: pass + except Exception: + pass # That should garbage-collect and close it, too self.sock = None diff --git a/bin/service/web_services.py b/bin/service/web_services.py index 1a710708810..aa52e030252 100644 --- a/bin/service/web_services.py +++ b/bin/service/web_services.py @@ -305,7 +305,7 @@ class db(netsvc.ExportService): else: cr.execute("select decode(datname, 'escape') from pg_database where datname not in('template0', 'template1','postgres') order by datname") res = [str(name) for (name,) in cr.fetchall()] - except: + except Exception: res = [] finally: cr.close() @@ -497,7 +497,7 @@ GNU Public Licence. try: try: base64_decoded = base64.decodestring(zips[module]) - except: + except Exception: l.notifyChannel('migration', netsvc.LOG_ERROR, 'unable to read the module %s' % (module,)) raise @@ -506,13 +506,13 @@ GNU Public Licence. try: try: tools.extract_zip_file(zip_contents, tools.config['addons_path'] ) - except: + except Exception: l.notifyChannel('migration', netsvc.LOG_ERROR, 'unable to extract the module %s' % (module, )) rmtree(module) raise finally: zip_contents.close() - except: + except Exception: l.notifyChannel('migration', netsvc.LOG_ERROR, 'restore the previous version of the module %s' % (module, )) nmp = os.path.join(backup_directory, module) if os.path.isdir(nmp):