From 40758b52221bde338717c259fdd71b7cd852c0a4 Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Mon, 26 Jul 2010 12:33:35 +0300 Subject: [PATCH] httpd, netrpcd: do not catch any exceptions always only catch Exception. Conflicts: bin/service/netrpc_server.py bin/service/web_services.py bin/service/websrv_lib.py bzr revid: p_christ@hol.gr-20100726093335-08uzfv3cr9ffx1ue --- bin/service/netrpc_server.py | 3 ++- bin/service/web_services.py | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) 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):