New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(import_app): print original exception on AppImportError #1334

Merged
merged 4 commits into from Oct 3, 2016

Conversation

Projects
None yet
3 participants
@ptbrowne
Contributor

ptbrowne commented Aug 23, 2016

Useful when you have a NameError in the code that creates your app.

Show outdated Hide outdated gunicorn/util.py
@@ -387,6 +387,8 @@ def import_app(module):
try:
app = eval(obj, mod.__dict__)
except NameError:
exc_type, exc_value, exc_traceback = sys.exc_info()
traceback.print_exception(exc_type, exc_value, exc_traceback)

This comment has been minimized.

@benoitc

benoitc Sep 23, 2016

Owner

this should only be done when debug mode is enabled. If not it can expose some unwanted to externals systems looking at the output.

@benoitc

benoitc Sep 23, 2016

Owner

this should only be done when debug mode is enabled. If not it can expose some unwanted to externals systems looking at the output.

This comment has been minimized.

@ptbrowne

ptbrowne Sep 23, 2016

Contributor

By debug mode, do you mean checking the logging level ?

@ptbrowne

ptbrowne Sep 23, 2016

Contributor

By debug mode, do you mean checking the logging level ?

This comment has been minimized.

@benoitc
@benoitc

This comment has been minimized.

@tilgovi

tilgovi Sep 26, 2016

Collaborator

Please either use star args to avoid locals or explicitly delete the traceback. See #1228.

@tilgovi

tilgovi Sep 26, 2016

Collaborator

Please either use star args to avoid locals or explicitly delete the traceback. See #1228.

Show outdated Hide outdated gunicorn/util.py
@@ -387,6 +387,8 @@ def import_app(module):
try:
app = eval(obj, mod.__dict__)
except NameError:
exc_type, exc_value, exc_traceback = sys.exc_info()
traceback.print_exception(exc_type, exc_value, exc_traceback)

This comment has been minimized.

@tilgovi

tilgovi Sep 26, 2016

Collaborator

Please either use star args to avoid locals or explicitly delete the traceback. See #1228.

@tilgovi

tilgovi Sep 26, 2016

Collaborator

Please either use star args to avoid locals or explicitly delete the traceback. See #1228.

@tilgovi

This comment has been minimized.

Show comment
Hide comment
@tilgovi

tilgovi Oct 1, 2016

Collaborator

@ptbrowne I think this is waiting for very minor changes from you. Please let us know if you will have time to do this.

Collaborator

tilgovi commented Oct 1, 2016

@ptbrowne I think this is waiting for very minor changes from you. Please let us know if you will have time to do this.

@ptbrowne

This comment has been minimized.

Show comment
Hide comment
@ptbrowne

ptbrowne Oct 3, 2016

Contributor

@tilgovi, sorry for the wait, it should be ok now :)

Contributor

ptbrowne commented Oct 3, 2016

@tilgovi, sorry for the wait, it should be ok now :)

@tilgovi

This comment has been minimized.

Show comment
Hide comment
@tilgovi

tilgovi Oct 3, 2016

Collaborator

Not a long wait at all, @ptbrowne! I just happened to process this in a batch of commenting on other issues and PRs. I've been high volume, high latency in my attention to Gunicorn lately.

Looks good to me.

Collaborator

tilgovi commented Oct 3, 2016

Not a long wait at all, @ptbrowne! I just happened to process this in a batch of commenting on other issues and PRs. I've been high volume, high latency in my attention to Gunicorn lately.

Looks good to me.

@tilgovi

tilgovi approved these changes Oct 3, 2016

@tilgovi tilgovi merged commit 915c534 into benoitc:master Oct 3, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

fofanov pushed a commit to fofanov/gunicorn that referenced this pull request Mar 16, 2018

feat(import_app): print original exception on AppImportError (#1334)
* feat(import_app): print original exception on AppImportError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment