{"action":"created","issue":{"url":"https://api.github.com/repos/benoitc/gunicorn/issues/1397","repository_url":"https://api.github.com/repos/benoitc/gunicorn","labels_url":"https://api.github.com/repos/benoitc/gunicorn/issues/1397/labels{/name}","comments_url":"https://api.github.com/repos/benoitc/gunicorn/issues/1397/comments","events_url":"https://api.github.com/repos/benoitc/gunicorn/issues/1397/events","html_url":"https://github.com/benoitc/gunicorn/issues/1397","id":190369483,"number":1397,"title":"Reloader not handling syntax errors any more","user":{"login":"brondsem","id":19553,"avatar_url":"https://avatars.githubusercontent.com/u/19553?v=3","gravatar_id":"","url":"https://api.github.com/users/brondsem","html_url":"https://github.com/brondsem","followers_url":"https://api.github.com/users/brondsem/followers","following_url":"https://api.github.com/users/brondsem/following{/other_user}","gists_url":"https://api.github.com/users/brondsem/gists{/gist_id}","starred_url":"https://api.github.com/users/brondsem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brondsem/subscriptions","organizations_url":"https://api.github.com/users/brondsem/orgs","repos_url":"https://api.github.com/users/brondsem/repos","events_url":"https://api.github.com/users/brondsem/events{/privacy}","received_events_url":"https://api.github.com/users/brondsem/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-11-18T16:59:41Z","updated_at":"2016-11-24T17:47:18Z","closed_at":null,"body":"When running gunicorn 19.4.x with `--reload` it would trap any \"bad\" python errors like `SyntaxError` or `IndentationError` and show them on the page.  Very useful.\r\n\r\nBut in 19.5 and 19.6 it doesn't serve the error message properly, shows an empty page and the logs have this error:\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"/allura-data/virtualenv/local/lib/python2.7/site-packages/gunicorn/workers/sync.py\", line 182, in handle_request\r\n    resp.write(item)\r\n  File \"/allura-data/virtualenv/local/lib/python2.7/site-packages/gunicorn/http/wsgi.py\", line 344, in write\r\n    raise TypeError('%r is not a byte' % arg)\r\nTypeError: ['  File \"/allura-data/virtualenv/local/lib/python2.7/site-packages/gunicorn/workers/base.py\", line 136, in load_wsgi\\n    self.wsgi = self.app.wsgi()\\n', '  File \"/allura-data/virtualenv/local/lib/python2.7/site-packages/gunicorn/app/base.py\", line 67, in wsgi\\n    self.callable = self.load()\\n', '  File \"/allura-data/virtualenv/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py\", line 63, in load\\n    return self.load_pasteapp()\\n', '  File \"/allura-data/virtualenv/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py\", line 59, in load_pasteapp\\n    return load_pasteapp(self.cfgurl, self.relpath, global_conf=None)\\n', '  File \"/allura-data/virtualenv/local/lib/python2.7/site-packages/gunicorn/app/pasterapp.py\", line 69, in load_pasteapp\\n    global_conf=global_conf)\\n', '  File \"/allura-data/virtualenv/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py\", line 247, in loadapp\\n    return loadobj(APP, uri, name=name, **kw)\\n', '  File \"/allura-data/virtualenv/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py\", line 272, in loadobj\\n    return context.create()\\n', '  File \"/allura-data/virtualenv/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py\", line 710, in create\\n    return self.object_type.invoke(self)\\n', '  File \"/allura-data/virtualenv/local/lib/python2.7/site-packages/paste/deploy/loadwsgi.py\", line 146, in invoke\\n    return fix_call(context.object, context.global_conf, **context.local_conf)\\n', '  File \"/allura-data/virtualenv/local/lib/python2.7/site-packages/paste/deploy/util.py\", line 56, in fix_call\\n    val = callable(*args, **kw)\\n', '  File \"/allura/Allura/allura/config/middleware.py\", line 72, in make_app\\n    return _make_core_app(root, global_conf, full_stack, **app_conf)\\n', '  File \"/allura/Allura/allura/config/middleware.py\", line 121, in _make_core_app\\n    load_environment(global_conf, app_conf)\\n', '  File \"/allura-data/virtualenv/local/lib/python2.7/site-packages/tg/configuration.py\", line 641, in load_environment\\n    self.setup_helpers_and_globals()\\n', '  File \"/allura-data/virtualenv/local/lib/python2.7/site-packages/tg/configuration.py\", line 304, in setup_helpers_and_globals\\n    config[\\'pylons.app_globals\\'] = self.package.lib.app_globals.Globals()\\n', '  File \"/allura/Allura/allura/lib/app_globals.py\", line 295, in __init__\\n    tool=_cache_eps(\\'allura\\', dict_cls=utils.CaseInsensitiveDict),\\n', '  File \"/allura/Allura/allura/lib/app_globals.py\", line 284, in _cache_eps\\n    value = ep.load()\\n', '  File \"/allura-data/virtualenv/local/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 2291, in load\\n    return self.resolve()\\n', '  File \"/allura-data/virtualenv/local/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 2297, in resolve\\n    module = __import__(self.module_name, fromlist=[\\'__name__\\'], level=0)\\n', '  File \"/allura/Allura/allura/ext/user_profile/__init__.py\", line 18, in <module>\\n    from .user_main import UserProfileApp, ProfileSectionBase\\n', '  File \"/allura/Allura/allura/ext/user_profile/user_main.py\", line 35, in <module>\\n    from allura.app import Application, SitemapEntry\\n', '  File \"/allura/Allura/allura/app.py\", line 45, in <module>\\n    from allura.controllers import BaseController\\n', '  File \"/allura/Allura/allura/controllers/__init__.py\", line 21, in <module>\\n    from .discuss import DiscussionController, AppDiscussionController, ThreadController, PostController\\n'] is not a byte\r\n```\r\n\r\nAnd in latest master (with `--reload poll` as it seems bare `--reload` no longer works), it throws:\r\n\r\n```\r\n[2016-11-18 16:45:32 +0000] [20] [ERROR] Exception in worker process\r\nTraceback (most recent call last):\r\n  File \"/allura-data/virtualenv/local/lib/python2.7/site-packages/gunicorn/arbiter.py\", line 557, in spawn_worker\r\n    worker.init_process()\r\n  File \"/allura-data/virtualenv/local/lib/python2.7/site-packages/gunicorn/workers/base.py\", line 115, in init_process\r\n    self.load_wsgi()\r\n  File \"/allura-data/virtualenv/local/lib/python2.7/site-packages/gunicorn/workers/base.py\", line 157, in load_wsgi\r\n    self.reloader.add_extra_file(exc_val.filename)\r\nAttributeError: 'NoneType' object has no attribute 'add_extra_file'\r\n```"},"comment":{"url":"https://api.github.com/repos/benoitc/gunicorn/issues/comments/262824563","html_url":"https://github.com/benoitc/gunicorn/issues/1397#issuecomment-262824563","issue_url":"https://api.github.com/repos/benoitc/gunicorn/issues/1397","id":262824563,"user":{"login":"daker","id":878518,"avatar_url":"https://avatars.githubusercontent.com/u/878518?v=3","gravatar_id":"","url":"https://api.github.com/users/daker","html_url":"https://github.com/daker","followers_url":"https://api.github.com/users/daker/followers","following_url":"https://api.github.com/users/daker/following{/other_user}","gists_url":"https://api.github.com/users/daker/gists{/gist_id}","starred_url":"https://api.github.com/users/daker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daker/subscriptions","organizations_url":"https://api.github.com/users/daker/orgs","repos_url":"https://api.github.com/users/daker/repos","events_url":"https://api.github.com/users/daker/events{/privacy}","received_events_url":"https://api.github.com/users/daker/received_events","type":"User","site_admin":false},"created_at":"2016-11-24T17:47:18Z","updated_at":"2016-11-24T17:47:18Z","body":"The PR should fix this issue, i have pushed a fix for the error page by reverting commit https://github.com/benoitc/gunicorn/commit/03a944d66854e8c3a873973c2732a99f205b13fd"}}
{"actor":{"display_login":"daker"}}