From e5310d15e9cae4a9f7df645ac5f5966377afb9ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Dusenne?= Date: Mon, 30 Dec 2019 08:39:03 -0500 Subject: [PATCH] add os.path.abspath() in dirname generation of the reloader Otherwise adding a watcher for a file located in the working directory generates an empty dirname, resulting in the following error: inotify.calls.InotifyError: Call failed (should not be -1): (-1) ERRNO=(0) Caused by the fact that we call inotify with an empty path --- gunicorn/reloader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gunicorn/reloader.py b/gunicorn/reloader.py index d00be2bf..66d98c55 100644 --- a/gunicorn/reloader.py +++ b/gunicorn/reloader.py @@ -92,7 +92,7 @@ if has_inotify: def get_dirs(self): fnames = [ - os.path.dirname(COMPILED_EXT_RE.sub('py', module.__file__)) + os.path.dirname(os.path.abspath(COMPILED_EXT_RE.sub('py', module.__file__))) for module in tuple(sys.modules.values()) if getattr(module, '__file__', None) ]