From da3b89b76550699a7475c31f3fbc56bbee8398db Mon Sep 17 00:00:00 2001 From: Joshua Kugler Date: Thu, 29 Oct 2020 17:26:59 -0800 Subject: [PATCH] The signature of __init__ on the "fall through" InotifyReloader was missing the extra_files paramater, so specifying the inotify reload engine on the command line when one did not have inotify installed would, instead of a nice message about needed inotify installed would result in the following traceback: ``` [2020-10-30 00:55:43 +0000] [7] [ERROR] Exception in worker process Traceback (most recent call last): File "/usr/lib/python3/dist-packages/gunicorn/arbiter.py", line 583, in spawn_worker worker.init_process() File "/usr/lib/python3/dist-packages/gunicorn/workers/base.py", line 132, in init_process self.reloader = reloader_cls(extra_files=self.cfg.reload_extra_files, TypeError: __init__() got an unexpected keyword argument 'extra_files' ``` I didn't see an easy way to writing a test for this, but would be happy to take pointers. --- gunicorn/reloader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gunicorn/reloader.py b/gunicorn/reloader.py index c1964785..5db57bab 100644 --- a/gunicorn/reloader.py +++ b/gunicorn/reloader.py @@ -118,7 +118,7 @@ if has_inotify: else: class InotifyReloader(object): - def __init__(self, callback=None): + def __init__(self, extra_files=None, callback=None): raise ImportError('You must have the inotify module installed to ' 'use the inotify reloader')