Skip to content
Myr

Merge branch '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 c935eac, 07a7058 · Browse files · 3 files+24 added−1 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+24 added−1 removed

  • tests:+17 added−0 removed
  • other:+7 added−1 removed

3 files+24 added−1 removed

modified:flask/app.py+3 added
1989 unmodified lines
1990 response = self.full_dispatch_request()1991 except Exception as e:1992 error = e1993 response = self.handle_exception(e)1994 except:1995 error = sys.exc_info()[1]1996 raise1997 return response(environ, start_response)1998 finally:1999 if self.should_ignore_error(error):2000 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
903 unmodified lines
modified:CHANGES+4 added-1 removed
16 unmodified lines
1718Version 0.12.119--------------2021Bugfix release, unreleased21Bugfix release, released on March 31st 20172223- Prevent `flask run` from showing a NoAppException when an ImportError occurs24 within the imported application module.25- Fix encoding behavior of ``app.config.from_pyfile`` for Python 3. Fix26 ``#2118``.27- Use the ``SERVER_NAME`` config if it is present as default values for28 ``app.run``. ``#2109``, ``#2152``29- Call `ctx.auto_pop` with the exception object instead of `None`, in the30 event that a `BaseException` such as `KeyboardInterrupt` is raised in a31 request handler.3233Version 0.1234------------35
593 unmodified lines