diff --git a/docs/gunicorn_ext.py b/docs/gunicorn_ext.py index 932ac022..155b0102 100755 --- a/docs/gunicorn_ext.py +++ b/docs/gunicorn_ext.py @@ -36,8 +36,9 @@ PULL_REQUEST_URI = 'https://github.com/benoitc/gunicorn/pull/%s' def format_settings(app): settings_file = os.path.join(app.srcdir, "settings.rst") ret = [] - for i, s in enumerate(guncfg.KNOWN_SETTINGS): - if i == 0 or s.section != guncfg.KNOWN_SETTINGS[i - 1].section: + known_settings = sorted(guncfg.KNOWN_SETTINGS, key=lambda s: s.section) + for i, s in enumerate(known_settings): + if i == 0 or s.section != known_settings[i - 1].section: ret.append("%s\n%s\n\n" % (s.section, "-" * len(s.section))) ret.append(fmt_setting(s)) diff --git a/docs/source/news.rst b/docs/source/news.rst index 05a4b413..3267047e 100644 --- a/docs/source/news.rst +++ b/docs/source/news.rst @@ -2,14 +2,16 @@ Changelog ========= -19.9.0 / not released -===================== +19.x / not released +=================== +- fix: prevent raising :exc:`AttributeError` when ``--reload`` is not passed + in case of a :exc:`SyntaxError` raised from the WSGI application. + (:issue:`1805`, :pr:`1806`) - The internal module ``gunicorn.workers.async`` was renamed to ``gunicorn.workers.base_async`` since ``async`` is now a reserved word in Python 3.7. (:pr:`1527`) - 19.8.1 / 2018/04/30 =================== diff --git a/gunicorn/workers/base.py b/gunicorn/workers/base.py index ce40796f..881efa0f 100644 --- a/gunicorn/workers/base.py +++ b/gunicorn/workers/base.py @@ -137,7 +137,7 @@ class Worker(object): try: self.wsgi = self.app.wsgi() except SyntaxError as e: - if self.cfg.reload == 'off': + if not self.cfg.reload: raise self.log.exception(e)