From e6b91eb55a129687ece64d635ea3412446d78128 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Thu, 27 Jul 2017 13:40:19 +0200 Subject: [PATCH] [FIX] core: werkzeug 0.12 compatibility Since werkzeug 0.12, the `BaseWSGIServer.__init__` method expect the socket to be bound to determine the effective port it listen to [1]. Stop pretend to bind the socket and close it directly after use. [1] see pallets/werkzeug@1fc28cbb30799bf6a09d998aa33f489c5e5a1a71 --- openerp/service/server.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/openerp/service/server.py b/openerp/service/server.py index 3cfbd3a2834..58e0345385d 100644 --- a/openerp/service/server.py +++ b/openerp/service/server.py @@ -66,12 +66,11 @@ class BaseWSGIServerNoBind(LoggingBaseWSGIServerMixIn, werkzeug.serving.BaseWSGI use this class, sets the socket and calls the process_request() manually """ def __init__(self, app): - werkzeug.serving.BaseWSGIServer.__init__(self, "1", "1", app) - def server_bind(self): - # we dont bind beause we use the listen socket of PreforkServer#socket - # instead we close the socket + werkzeug.serving.BaseWSGIServer.__init__(self, "127.0.0.1", 0, app) + # Directly close the socket. It will be replaced by WorkerHTTP when processing requests if self.socket: self.socket.close() + def server_activate(self): # dont listen as we use PreforkServer#socket pass