Skip to content
Myr

various typo fixes

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

authored by Finbarr O'Callaghan · committed by Finbarr O'Callaghan · parent 80b2689 · Browse files · 6 files+18 added−18 removed
This commit

State

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

Diff stats

6 files+18 added−18 removed

  • other:+18 added−18 removed

6 files+18 added−18 removed

modified:docs/appcontext.rst+2 added-2 removed
35 unmodified lines
3637Purpose of the Application Context38----------------------------------3940The main reason for the application's context existance is that in the40The main reason for the application's context existence is that in the41past a bunch of functionality was attached to the request context in lack42of a better solution. Since one of the pillar's of Flask's design is that43you can have more than one application in the same Python process.44
12 unmodified lines
5758To make an application context there are two ways. The first one is the59implicit one: whenever a request context is pushed, an application context60will be created alongside if this is necessary. As a result of that, you61can ignore the existance of the application context unless you need it.61can ignore the existence of the application context unless you need it.6263The second way is the explicit way using the64:meth:`~flask.Flask.app_context` method::65
22 unmodified lines
modified:docs/upgrading.rst+1 added-1 removed
189 unmodified lines
190``````````````````````````````191192While it is still possible to attach error handlers to193:attr:`Flask.error_handlers` it's discouraged to do so and in fact194deprecated. In generaly we no longer recommend custom error handler194deprecated. In generally we no longer recommend custom error handler195attaching via assignments to the underlying dictionary due to the more196complex internal handling to support arbitrary exception classes and197blueprints. See :meth:`Flask.errorhandler` for more information.198
148 unmodified lines
modified:flask/testsuite/subclassing.py+4 added-4 removed
16 unmodified lines
171819class FlaskSubclassingTestCase(FlaskTestCase):2021 def test_supressed_exception_logging(self):22 class SupressedFlask(flask.Flask):21 def test_suppressed_exception_logging(self):22 class SuppressedFlask(flask.Flask):23 def log_exception(self, exc_info):24 pass2526 out = StringIO()27 app = SupressedFlask(__name__)28 app.logger_name = 'flask_tests/test_supressed_exception_logging'27 app = SuppressedFlask(__name__)28 app.logger_name = 'flask_tests/test_suppressed_exception_logging'29 app.logger.addHandler(StreamHandler(out))3031 @app.route('/')32 def index():
14 unmodified lines
modified:flask/app.py+9 added-9 removed
539 unmodified lines
540 in debug mode. This logger can be used to (surprise) log messages.541 Here some examples::542543 app.logger.debug('A value for debugging')544 app.logger.warning('A warning ocurred (%d apples)', 42)545 app.logger.error('An error occoured')544 app.logger.warning('A warning occurred (%d apples)', 42)545 app.logger.error('An error occurred')546547 .. versionadded:: 0.3548 """549 if self._logger and self._logger.name == self.logger_name:
295 unmodified lines
845 """846 first_registration = False847 if blueprint.name in self.blueprints:848 assert self.blueprints[blueprint.name] is blueprint, \849 'A blueprint\'s name collision ocurred between %r and ' \849 'A blueprint\'s name collision occurred between %r and ' \850 '%r. Both share the same name "%s". Blueprints that ' \851 'are created on the fly need unique names.' % \852 (blueprint, self.blueprints[blueprint.name], blueprint.name)853 else:
253 unmodified lines
1107 must take one parameter, a :attr:`response_class` object and return1108 a new response object or the same (see :meth:`process_response`).11091110 As of Flask 0.7 this function might not be executed at the end of the1111 request in case an unhandled exception ocurred.1111 request in case an unhandled exception occurred.1112 """1113 self.after_request_funcs.setdefault(None, []).append(f)1114 return f1115
15 unmodified lines
1131 functions are called just before the request context moves from the1132 stack of active contexts. This becomes relevant if you are using1133 such constructs in tests.11341135 Generally teardown functions must take every necesary step to avoid1135 Generally teardown functions must take every necessary step to avoid1136 that they will fail. If they do execute code that might fail they1137 will have to surround the execution of these code by try/except1138 statements and log ocurring errors.1138 statements and log occurring errors.11391140 When a teardown function was called because of a exception it will1141 be passed an error object.1142 """
121 unmodified lines
1264 raise exc_type, exc_value, tb12651266 def handle_exception(self, e):1267 """Default exception handling that kicks in when an exception1268 occours that is not caught. In debug mode the exception will1268 occurs that is not caught. In debug mode the exception will1269 be re-raised immediately, otherwise it is logged and the handler1270 for a 500 internal server error is used. If no such handler1271 exists, a default 500 internal server error message is displayed.1272
248 unmodified lines
1521 if it was the return value from the view and further1522 request handling is stopped.15231524 This also triggers the :meth:`url_value_processor` functions before1525 the actualy :meth:`before_request` functions are called.1525 the actually :meth:`before_request` functions are called.1526 """1527 bp = _request_ctx_stack.top.request.blueprint15281529 funcs = self.url_value_preprocessors.get(None, ())
144 unmodified lines
1674 .. versionchanged:: 0.71675 The behavior of the before and after request callbacks was changed1676 under error conditions and a new callback was added that will1677 always execute at the end of the request, independent on if an1678 error ocurred or not. See :ref:`callbacks-and-errors`.1678 error occurred or not. See :ref:`callbacks-and-errors`.16791680 :param environ: a WSGI environment1681 :param start_response: a callable accepting a status code,1682 a list of headers and an optional
19 unmodified lines
modified:flask/exthook.py+1 added-1 removed
108 unmodified lines
109 # name shows up properly here. Success!110 if module_name == important_module:111 return True112113 # Some python verisons will will clean up modules so early that the113 # Some python versions will will clean up modules so early that the114 # module name at that point is no longer set. Try guessing from115 # the filename then.116 filename = os.path.abspath(tb.tb_frame.f_code.co_filename)117 test_string = os.path.sep + important_module.replace('.', os.path.sep)
2 unmodified lines
modified:flask/wrappers.py+1 added-1 removed
106 unmodified lines
107 return self.on_json_loading_failed(e)108109 def on_json_loading_failed(self, e):110 """Called if decoding of the JSON data failed. The return value of111 this method is used by :attr:`json` when an error ocurred. The default111 this method is used by :attr:`json` when an error occurred. The default112 implementation raises a :class:`JSONBadRequest`, which is a subclass of113 :class:`~werkzeug.exceptions.BadRequest` which sets the114 ``Content-Type`` to ``application/json`` and provides a JSON-formatted115 error description::
33 unmodified lines