Skip to content
Myr

Merge branch '2.0.x'

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

authored by David Lord · committed by David Lord · parents 83f7efa, e22021d · Browse files · 10 files+260 added−96 removed
This commit

State

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

Diff stats

10 files+260 added−96 removed

  • tests:+64 added−35 removed
  • other:+196 added−61 removed

10 files+260 added−96 removed

modified:docs/patterns/viewdecorators.rst+1 added-1 removed
140 unmodified lines
141 @wraps(f)142 def decorated_function(*args, **kwargs):143 template_name = template144 if template_name is None:145 template_name = f"'{request.endpoint.replace('.', '/')}.html'"145 template_name = f"{request.endpoint.replace('.', '/')}.html"146 ctx = f(*args, **kwargs)147 if ctx is None:148 ctx = {}149 elif not isinstance(ctx, dict):
22 unmodified lines
modified:src/flask/app.py+29 added-17 removed
34 unmodified lines
35from .globals import _request_ctx_stack36from .globals import g37from .globals import request38from .globals import session39from .helpers import _split_blueprint_path40from .helpers import get_debug_flag41from .helpers import get_env42from .helpers import get_flashed_messages43from .helpers import get_load_dotenv
703 unmodified lines
747 TemplateContextProcessorCallable748 ] = self.template_context_processors[None]749 reqctx = _request_ctx_stack.top750 if reqctx is not None:750 for bp in self._request_blueprints():751 for bp in request.blueprints:752 if bp in self.template_context_processors:753 funcs = chain(funcs, self.template_context_processors[bp])754 orig_ctx = context.copy()755 for func in funcs:
262 unmodified lines
1018 :param options: Additional keyword arguments are passed to1019 :class:`~flask.blueprints.BlueprintSetupState`. They can be1020 accessed in :meth:`~flask.Blueprint.record` callbacks.10211022 .. versionchanged:: 2.0.11023 The ``name`` option can be used to change the (pre-dotted)1024 name the blueprint is registered with. This allows the same1025 blueprint to be registered multiple times with unique names1026 for ``url_for``.10271028 .. versionadded:: 0.71029 """1030 blueprint.register(self, options)1031
63 unmodified lines
1095 )1096 self.view_functions[endpoint] = view_func10971098 @setupmethod1092 def template_filter(self, name: t.Optional[str] = None) -> t.Callable:1099 def template_filter(1100 self, name: t.Optional[str] = None1101 ) -> t.Callable[[TemplateFilterCallable], TemplateFilterCallable]:1102 """A decorator that is used to register custom template filter.1103 You can specify a name for the filter, otherwise the function1104 name will be used. Example::1105
23 unmodified lines
1129 """1130 self.jinja_env.filters[name or f.__name__] = f11311132 @setupmethod1124 def template_test(self, name: t.Optional[str] = None) -> t.Callable:1133 def template_test(1134 self, name: t.Optional[str] = None1135 ) -> t.Callable[[TemplateTestCallable], TemplateTestCallable]:1136 """A decorator that is used to register custom template test.1137 You can specify a name for the test, otherwise the function1138 name will be used. Example::1139
32 unmodified lines
1172 """1173 self.jinja_env.tests[name or f.__name__] = f11741175 @setupmethod1165 def template_global(self, name: t.Optional[str] = None) -> t.Callable:1176 def template_global(1177 self, name: t.Optional[str] = None1178 ) -> t.Callable[[TemplateGlobalCallable], TemplateGlobalCallable]:1179 """A decorator that is used to register a custom template global function.1180 You can specify a name for the global function, otherwise the function1181 name will be used. Example::1182
90 unmodified lines
1273 """1274 exc_class, code = self._get_exc_class_and_code(type(e))12751276 for c in [code, None]:1264 for name in chain(self._request_blueprints(), [None]):1277 for name in chain(request.blueprints, [None]):1278 handler_map = self.error_handler_spec[name][c]12791280 if not handler_map:1281 continue
512 unmodified lines
17941795 .. versionadded:: 0.71796 """1797 funcs: t.Iterable[URLDefaultCallable] = self.url_default_functions[None]17981799 if "." in endpoint:1786 bp = endpoint.rsplit(".", 1)[0]1787 funcs = chain(funcs, self.url_default_functions[bp])1800 # This is called by url_for, which can be called outside a1801 # request, can't use request.blueprints.1802 bps = _split_blueprint_path(endpoint.rpartition(".")[0])1803 bp_funcs = chain.from_iterable(self.url_default_functions[bp] for bp in bps)1804 funcs = chain(funcs, bp_funcs)18051806 for func in funcs:1807 func(endpoint, values)18081809 def handle_url_build_error(
32 unmodified lines
18421843 funcs: t.Iterable[URLValuePreprocessorCallable] = self.url_value_preprocessors[1844 None1845 ]1828 for bp in self._request_blueprints():1846 for bp in request.blueprints:1847 if bp in self.url_value_preprocessors:1848 funcs = chain(funcs, self.url_value_preprocessors[bp])1849 for func in funcs:1850 func(request.endpoint, request.view_args)18511852 funcs: t.Iterable[BeforeRequestCallable] = self.before_request_funcs[None]1835 for bp in self._request_blueprints():1853 for bp in request.blueprints:1854 if bp in self.before_request_funcs:1855 funcs = chain(funcs, self.before_request_funcs[bp])1856 for func in funcs:1857 rv = self.ensure_sync(func)()
16 unmodified lines
1874 instance of :attr:`response_class`.1875 """1876 ctx = _request_ctx_stack.top1877 funcs: t.Iterable[AfterRequestCallable] = ctx._after_request_functions1860 for bp in self._request_blueprints():1878 for bp in request.blueprints:1879 if bp in self.after_request_funcs:1880 funcs = chain(funcs, reversed(self.after_request_funcs[bp]))1881 if None in self.after_request_funcs:1882 funcs = chain(funcs, reversed(self.after_request_funcs[None]))
30 unmodified lines
1913 exc = sys.exc_info()[1]1914 funcs: t.Iterable[TeardownCallable] = reversed(1915 self.teardown_request_funcs[None]1916 )1899 for bp in self._request_blueprints():1917 for bp in request.blueprints:1918 if bp in self.teardown_request_funcs:1919 funcs = chain(funcs, reversed(self.teardown_request_funcs[bp]))1920 for func in funcs:1921 self.ensure_sync(func)(exc)
163 unmodified lines
2085 WSGI application. This calls :meth:`wsgi_app`, which can be2086 wrapped to apply middleware.2087 """2088 return self.wsgi_app(environ, start_response)20712072 def _request_blueprints(self) -> t.Iterable[str]:2073 if _request_ctx_stack.top.request.blueprint is None:2074 return []2075 else:2076 return reversed(_request_ctx_stack.top.request.blueprint.split("."))
modified:src/flask/blueprints.py+76 added-25 removed
65 unmodified lines
66 #: The prefix that should be used for all URLs defined on the67 #: blueprint.68 self.url_prefix = url_prefix6970 self.name = self.options.get("name", blueprint.name)71 self.name_prefix = self.options.get("name_prefix", "")7273 #: A dictionary with URL defaults that is added to each and every74 #: URL that was defined with the blueprint.
21 unmodified lines
96 endpoint = _endpoint_from_view_func(view_func) # type: ignore97 defaults = self.url_defaults98 if "defaults" in options:99 defaults = dict(defaults, **options.pop("defaults"))100101 self.app.add_url_rule(102 rule,101 f"{self.name_prefix}{self.blueprint.name}.{endpoint}",103 f"{self.name_prefix}.{self.name}.{endpoint}".lstrip("."),104 view_func,105 defaults=defaults,106 **options,107 )
145 unmodified lines
253 """Register a :class:`~flask.Blueprint` on this blueprint. Keyword254 arguments passed to this method will override the defaults set255 on the blueprint.256257 .. versionchanged:: 2.0.1258 The ``name`` option can be used to change the (pre-dotted)259 name the blueprint is registered with. This allows the same260 blueprint to be registered multiple times with unique names261 for ``url_for``.262263 .. versionadded:: 2.0264 """265 if blueprint is self:266 raise ValueError("Cannot register a blueprint on itself")267 self._blueprints.append((blueprint, options))268269 def register(self, app: "Flask", options: dict) -> None:270 """Called by :meth:`Flask.register_blueprint` to register all
4 unmodified lines
275 :param app: The application this blueprint is being registered276 with.277 :param options: Keyword arguments forwarded from278 :meth:`~Flask.register_blueprint`.269 :param first_registration: Whether this is the first time this270 blueprint has been registered on the application.279280 .. versionchanged:: 2.0.1281 Nested blueprints are registered with their dotted name.282 This allows different blueprints with the same name to be283 nested at different locations.284285 .. versionchanged:: 2.0.1286 The ``name`` option can be used to change the (pre-dotted)287 name the blueprint is registered with. This allows the same288 blueprint to be registered multiple times with unique names289 for ``url_for``.290291 .. versionchanged:: 2.0.1292 Registering the same blueprint with the same name multiple293 times is deprecated and will become an error in Flask 2.1.294 """272 first_registration = False295 first_registration = not any(bp is self for bp in app.blueprints.values())296 name_prefix = options.get("name_prefix", "")297 self_name = options.get("name", self.name)298 name = f"{name_prefix}.{self_name}".lstrip(".")299274 if self.name in app.blueprints:275 assert app.blueprints[self.name] is self, (276 "A name collision occurred between blueprints"277 f" {self!r} and {app.blueprints[self.name]!r}."278 f" Both share the same name {self.name!r}."279 f" Blueprints that are created on the fly need unique"280 f" names."281 )282 else:283 app.blueprints[self.name] = self284 first_registration = True300 if name in app.blueprints:301 existing_at = f" '{name}'" if self_name != name else ""302303 if app.blueprints[name] is not self:304 raise ValueError(305 f"The name '{self_name}' is already registered for"306 f" a different blueprint{existing_at}. Use 'name='"307 " to provide a unique name."308 )309 else:310 import warnings311312 warnings.warn(313 f"The name '{self_name}' is already registered for"314 f" this blueprint{existing_at}. Use 'name=' to"315 " provide a unique name. This will become an error"316 " in Flask 2.1.",317 stacklevel=4,318 )319320 app.blueprints[name] = self321 self._got_registered_once = True322 state = self.make_setup_state(app, options, first_registration)323324 if self.has_static_folder:
7 unmodified lines
332 if first_registration:333334 def extend(bp_dict, parent_dict):335 for key, values in bp_dict.items():301 key = self.name if key is None else f"{self.name}.{key}"302336 key = name if key is None else f"{name}.{key}"337 parent_dict[key].extend(values)338339 for key, value in self.error_handler_spec.items():306 key = self.name if key is None else f"{self.name}.{key}"340 key = name if key is None else f"{name}.{key}"341 value = defaultdict(342 dict,343 {344 code: {
25 unmodified lines
370 if self.cli.commands:371 if cli_resolved_group is None:372 app.cli.commands.update(self.cli.commands)373 elif cli_resolved_group is _sentinel:340 self.cli.name = self.name374 self.cli.name = name375 app.cli.add_command(self.cli)376 else:377 self.cli.name = cli_resolved_group378 app.cli.add_command(self.cli)
8 unmodified lines
387 if state.url_prefix is not None and bp_url_prefix is not None:388 bp_options["url_prefix"] = (389 state.url_prefix.rstrip("/") + "/" + bp_url_prefix.lstrip("/")390 )357 else:391 elif bp_url_prefix is not None:392 bp_options["url_prefix"] = bp_url_prefix393 elif state.url_prefix is not None:394 bp_options["url_prefix"] = state.url_prefix395360 bp_options["name_prefix"] = options.get("name_prefix", "") + self.name + "."396 bp_options["name_prefix"] = name397 blueprint.register(app, bp_options)398399 def add_url_rule(400 self,401 rule: str,402 endpoint: t.Optional[str] = None,403 view_func: t.Optional[t.Callable] = None,404 provide_automatic_options: t.Optional[bool] = None,405 **options: t.Any,406 ) -> None:407 """Like :meth:`Flask.add_url_rule` but for a blueprint. The endpoint for408 the :func:`url_for` function is prefixed with the name of the blueprint.
3 unmodified lines
412413 if view_func and hasattr(view_func, "__name__") and "." in view_func.__name__:414 raise ValueError("'view_func' name may not contain a dot '.' character.")415379 self.record(lambda s: s.add_url_rule(rule, endpoint, view_func, **options))416 self.record(417 lambda s: s.add_url_rule(418 rule,419 endpoint,420 view_func,421 provide_automatic_options=provide_automatic_options,422 **options,423 )424 )425381 def app_template_filter(self, name: t.Optional[str] = None) -> t.Callable:426 def app_template_filter(427 self, name: t.Optional[str] = None428 ) -> t.Callable[[TemplateFilterCallable], TemplateFilterCallable]:429 """Register a custom template filter, available application wide. Like430 :meth:`Flask.template_filter` but for a blueprint.431432 :param name: the optional name of the filter, otherwise the
21 unmodified lines
454 state.app.jinja_env.filters[name or f.__name__] = f455456 self.record_once(register_template)457411 def app_template_test(self, name: t.Optional[str] = None) -> t.Callable:458 def app_template_test(459 self, name: t.Optional[str] = None460 ) -> t.Callable[[TemplateTestCallable], TemplateTestCallable]:461 """Register a custom template test, available application wide. Like462 :meth:`Flask.template_test` but for a blueprint.463464 .. versionadded:: 0.10
25 unmodified lines
490 state.app.jinja_env.tests[name or f.__name__] = f491492 self.record_once(register_template)493445 def app_template_global(self, name: t.Optional[str] = None) -> t.Callable:494 def app_template_global(495 self, name: t.Optional[str] = None496 ) -> t.Callable[[TemplateGlobalCallable], TemplateGlobalCallable]:497 """Register a custom template global, available application wide. Like498 :meth:`Flask.template_global` but for a blueprint.499500 .. versionadded:: 0.10
103 unmodified lines
modified:src/flask/helpers.py+15 added-2 removed
4 unmodified lines
5import typing as t6import warnings7from datetime import datetime8from datetime import timedelta9from functools import lru_cache10from functools import update_wrapper11from threading import RLock1213import werkzeug.utils
49 unmodified lines
63 return val.lower() in ("0", "false", "no")646566def stream_with_context(66 generator_or_function: t.Union[t.Generator, t.Callable]67) -> t.Generator:67 generator_or_function: t.Union[68 t.Iterator[t.AnyStr], t.Callable[..., t.Iterator[t.AnyStr]]69 ]70) -> t.Iterator[t.AnyStr]:71 """Request contexts disappear when the response is started on the server.72 This is done for efficiency reasons and to make it less likely to encounter73 memory leaks with badly written WSGI middlewares. The downside is that if74 you are using streamed responses, the generator cannot access request bound
748 unmodified lines
823 else:824 return True825826 return False827828829@lru_cache(maxsize=None)830def _split_blueprint_path(name: str) -> t.List[str]:831 out: t.List[str] = [name]832833 if "." in name:834 out.extend(_split_blueprint_path(name.rpartition(".")[0]))835836 return out
modified:src/flask/scaffold.py+6 added-4 removed
31 unmodified lines
3233# a singleton sentinel value for parameter defaults34_sentinel = object()3536F = t.TypeVar("F", bound=t.Callable[..., t.Any])3737def setupmethod(f: t.Callable) -> t.Callable:3839def setupmethod(f: F) -> F:40 """Wraps a method so that it performs a check in debug mode if the41 first request was already handled.42 """43
10 unmodified lines
54 " requests."55 )56 return f(self, *args, **kwargs)5756 return update_wrapper(wrapper_func, f)58 return t.cast(F, update_wrapper(wrapper_func, f))596061class Scaffold:62 """Common behavior shared between :class:`~flask.Flask` and
381 unmodified lines
444 endpoint: t.Optional[str] = None,445 view_func: t.Optional[t.Callable] = None,446 provide_automatic_options: t.Optional[bool] = None,447 **options: t.Any,446 ) -> t.Callable:448 ) -> None:449 """Register a rule for routing incoming requests and building450 URLs. The :meth:`route` decorator is a shortcut to call this451 with the ``view_func`` argument. These are equivalent:452
190 unmodified lines
643644 @setupmethod645 def errorhandler(646 self, code_or_exception: t.Union[t.Type[Exception], int]645 ) -> t.Callable:647 ) -> t.Callable[[ErrorHandlerCallable], ErrorHandlerCallable]:648 """Register a function to handle errors by code or exception class.649650 A decorator that is used to register a function given an651 error code. Example::
213 unmodified lines
modified:src/flask/wrappers.py+43 added-11 removed
4 unmodified lines
5from werkzeug.wrappers import Response as ResponseBase67from . import json8from .globals import current_app9from .helpers import _split_blueprint_path1011if t.TYPE_CHECKING:12 import typing_extensions as te13 from werkzeug.routing import Rule
45 unmodified lines
59 return None6061 @property62 def endpoint(self) -> t.Optional[str]:62 """The endpoint that matched the request. This in combination with63 :attr:`view_args` can be used to reconstruct the same or a64 modified URL. If an exception happened when matching, this will65 be ``None``.63 """The endpoint that matched the request URL.6465 This will be ``None`` if matching failed or has not been66 performed yet.6768 This in combination with :attr:`view_args` can be used to69 reconstruct the same URL or a modified URL.70 """71 if self.url_rule is not None:72 return self.url_rule.endpoint69 else:70 return None7374 return None7576 @property77 def blueprint(self) -> t.Optional[str]:74 """The name of the current blueprint"""75 if self.url_rule and "." in self.url_rule.endpoint:76 return self.url_rule.endpoint.rsplit(".", 1)[0]77 else:78 return None78 """The registered name of the current blueprint.7980 This will be ``None`` if the endpoint is not part of a81 blueprint, or if URL matching failed or has not been performed82 yet.8384 This does not necessarily match the name the blueprint was85 created with. It may have been nested, or registered with a86 different name.87 """88 endpoint = self.endpoint8990 if endpoint is not None and "." in endpoint:91 return endpoint.rpartition(".")[0]9293 return None9495 @property96 def blueprints(self) -> t.List[str]:97 """The registered names of the current blueprint upwards through98 parent blueprints.99100 This will be an empty list if there is no current blueprint, or101 if URL matching failed.102103 .. versionadded:: 2.0.1104 """105 name = self.blueprint106107 if name is None:108 return []109110 return _split_blueprint_path(name)111112 def _load_form_data(self) -> None:113 RequestBase._load_form_data(self)114115 # In debug mode we're replacing the files multidict with an ad-hoc
52 unmodified lines
modified:tests/test_blueprints.py+64 added-35 removed
138 unmodified lines
139 def bar(bar):140 return str(bar)141142 app.register_blueprint(bp, url_prefix="/1", url_defaults={"bar": 23})143 app.register_blueprint(bp, url_prefix="/2", url_defaults={"bar": 19})143 app.register_blueprint(bp, name="test2", url_prefix="/2", url_defaults={"bar": 19})144145 assert client.get("/1/foo").data == b"23/42"146 assert client.get("/2/foo").data == b"19/42"147 assert client.get("/1/bar").data == b"23"
688 unmodified lines
836 assert client.get("/parent/child/no").data == b"Parent no"837 assert client.get("/parent/child/grandchild/no").data == b"Grandchild no"838839840def test_nested_blueprint_url_prefix(app, client):841 parent = flask.Blueprint("parent", __name__, url_prefix="/parent")842 child = flask.Blueprint("child", __name__, url_prefix="/child")843 grandchild = flask.Blueprint("grandchild", __name__, url_prefix="/grandchild")844 apple = flask.Blueprint("apple", __name__, url_prefix="/apple")840@pytest.mark.parametrize(841 "parent_init, child_init, parent_registration, child_registration",842 [843 ("/parent", "/child", None, None),844 ("/parent", None, None, "/child"),845 (None, None, "/parent", "/child"),846 ("/other", "/something", "/parent", "/child"),847 ],848)849def test_nesting_url_prefixes(850 parent_init,851 child_init,852 parent_registration,853 child_registration,854 app,855 client,856) -> None:857 parent = flask.Blueprint("parent", __name__, url_prefix=parent_init)858 child = flask.Blueprint("child", __name__, url_prefix=child_init)859846 @parent.route("/")847 def parent_index():848 return "Parent"849860 @child.route("/")851 def child_index():852 return "Child"861 def index():862 return "index"863854 @grandchild.route("/")855 def grandchild_index():856 return "Grandchild"864 parent.register_blueprint(child, url_prefix=child_registration)865 app.register_blueprint(parent, url_prefix=parent_registration)866858 @apple.route("/")859 def apple_index():860 return "Apple"867 response = client.get("/parent/child/")868 assert response.status_code == 200869862 child.register_blueprint(grandchild)863 child.register_blueprint(apple, url_prefix="/orange") # test overwrite864 parent.register_blueprint(child)865 app.register_blueprint(parent)870867 assert client.get("/parent/").data == b"Parent"868 assert client.get("/parent/child/").data == b"Child"869 assert client.get("/parent/child/grandchild/").data == b"Grandchild"870 assert client.get("/parent/child/orange/").data == b"Apple"871def test_unique_blueprint_names(app, client) -> None:872 bp = flask.Blueprint("bp", __name__)873 bp2 = flask.Blueprint("bp", __name__)874875 app.register_blueprint(bp)876873def test_nested_blueprint_url_prefix_only_parent_prefix(app, client):874 parent = flask.Blueprint("parent", __name__)875 child = flask.Blueprint("child", __name__)877 with pytest.warns(UserWarning):878 app.register_blueprint(bp) # same bp, same name, warning879877 @child.route("/child-endpoint")878 def child_index():879 return "Child"880 app.register_blueprint(bp, name="again") # same bp, different name, ok881881 parent.register_blueprint(child)882 app.register_blueprint(parent, url_prefix="/parent")882 with pytest.raises(ValueError):883 app.register_blueprint(bp2) # different bp, same name, error884884 assert client.get("/parent/child-endpoint").data == b"Child"885 app.register_blueprint(bp2, name="alt") # different bp, different name, ok886887888def test_self_registration(app, client) -> None:889 bp = flask.Blueprint("bp", __name__)890 with pytest.raises(ValueError):891 bp.register_blueprint(bp)892893894def test_blueprint_renaming(app, client) -> None:895 bp = flask.Blueprint("bp", __name__)896 bp2 = flask.Blueprint("bp2", __name__)897898 @bp.get("/")899 def index():900 return flask.request.endpoint901902 @bp2.get("/")903 def index2():904 return flask.request.endpoint905906 bp.register_blueprint(bp2, url_prefix="/a", name="sub")907 app.register_blueprint(bp, url_prefix="/a")908 app.register_blueprint(bp, url_prefix="/b", name="alt")909910 assert client.get("/a/").data == b"bp.index"911 assert client.get("/b/").data == b"alt.index"912 assert client.get("/a/a/").data == b"bp.sub.index2"913 assert client.get("/b/a/").data == b"alt.sub.index2"
modified:.gitignore+2 added
2 unmodified lines
3.flaskenv4*.pyc5*.pyo6env/7venv/8.venv/9env*10dist/11build/12*.egg
14 unmodified lines
modified:CHANGES.rst+18 added-1 removed
6 unmodified lines
78- Update Click dependency to >= 8.0.91011Version 2.0.111Version 2.0.212-------------1314Unreleased151617Version 2.0.118-------------1920Released 2021-05-212122- Re-add the ``filename`` parameter in ``send_from_directory``. The23 ``filename`` parameter has been renamed to ``path``, the old name24 is deprecated. :pr:`4019`25- Mark top-level names as exported so type checking understands
12 unmodified lines
38 URL is again matched after the session is loaded, so the session is39 available in custom URL converters. :issue:`4053`40- Re-add deprecated ``Config.from_json``, which was accidentally41 removed early. :issue:`4078`42- Improve typing for some functions using ``Callable`` in their type43 signatures, focusing on decorator factories. :issue:`4060`44- Nested blueprints are registered with their dotted name. This allows45 different blueprints with the same name to be nested at different46 locations. :issue:`4069`47- ``register_blueprint`` takes a ``name`` option to change the48 (pre-dotted) name the blueprint is registered with. This allows the49 same blueprint to be registered multiple times with unique names for50 ``url_for``. Registering the same blueprint with the same name51 multiple times is deprecated. :issue:`1091`52- Improve typing for ``stream_with_context``. :issue:`4052`535455Version 2.0.056-------------
1116 unmodified lines
modified:CONTRIBUTING.rst+6 added
110 unmodified lines
111112 > py -3 -m venv env113 > env\Scripts\activate114115- Upgrade pip and setuptools.116117 .. code-block:: text118119 $ python -m pip install --upgrade pip setuptools120121- Install the development dependencies, then install Flask in editable122 mode.123124 .. code-block:: text
103 unmodified lines