Skip to content
Myr

Merge branch 'Diggsey-db-handle-baseexceptions' into 0.12-maintenance

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Markus Unterwaditzer · committed by Markus Unterwaditzer · parents b0820bc, 6f7847e · Browse files · 3 files+35 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+35 added−0 removed

  • tests:+17 added−0 removed
  • other:+18 added−0 removed

3 files+35 added−0 removed

modified:flask/app.py+3 added
1981 unmodified lines
1982 response = self.full_dispatch_request()1983 except Exception as e:1984 error = e1985 response = self.handle_exception(e)1986 except:1987 error = sys.exc_info()[1]1988 raise1989 return response(environ, start_response)1990 finally:1991 if self.should_ignore_error(error):1992 error = None
11 unmodified lines
modified:tests/test_basic.py+17 added
789 unmodified lines
790 assert resp.mimetype == 'text/x-special'791 assert resp.data == b'internal server error'792793794def test_baseexception_error_handling():795 app = flask.Flask(__name__)796 app.config['LOGGER_HANDLER_POLICY'] = 'never'797798 @app.route('/')799 def broken_func():800 raise KeyboardInterrupt()801802 with app.test_client() as c:803 with pytest.raises(KeyboardInterrupt):804 c.get('/')805806 ctx = flask._request_ctx_stack.top807 assert ctx.preserved808 assert type(ctx._preserved_exc) is KeyboardInterrupt809810811def test_before_request_and_routing_errors():812 app = flask.Flask(__name__)813814 @app.before_request
886 unmodified lines
modified:CHANGES+15 added
1 unmodified line
2===============34Here you can see the full list of changes between each Flask release.56Version 0.137------------89Major release, unreleased1011- Make `app.run()` into a noop if a Flask application is run from the12 development server on the command line. This avoids some behavior that13 was confusing to debug for newcomers.14- Change default configuration `JSONIFY_PRETTYPRINT_REGULAR=False`. jsonify()15 method returns compressed response by default, and pretty response in16 debug mode.17- Call `ctx.auto_pop` with the exception object instead of `None`, in the18 event that a `BaseException` such as `KeyboardInterrupt` is raised in a19 request handler.2021Version 0.12.122--------------2324Bugfix release, unreleased
602 unmodified lines