We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Switch Jinja templates to line statements
Because they're easier to type (especially on an azerty keyboard): `% if ...` instead of `{% if ... %}`. [Documentation](http://jinja.pocoo.org/docs/dev/templates/#line-statements).

Any objections?


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `liberapay/utils/emails.py`
Content:
```
1 from __future__ import unicode_literals
2 
3 from aspen.simplates.pagination import parse_specline, split_and_escape
4 from aspen_jinja2_renderer import SimplateLoader
5 from jinja2 import Environment
6 
7 
8 ( VERIFICATION_MISSING
9 , VERIFICATION_FAILED
10 , VERIFICATION_EXPIRED
11 , VERIFICATION_REDUNDANT
12 , VERIFICATION_STYMIED
13 , VERIFICATION_SUCCEEDED
14  ) = range(6)
15 
16 
17 jinja_env = Environment(trim_blocks=True, lstrip_blocks=True)
18 jinja_env_html = Environment(
19     trim_blocks=True, lstrip_blocks=True,
20     autoescape=True, extensions=['jinja2.ext.autoescape'],
21 )
22 
23 def compile_email_spt(fpath):
24     r = {}
25     with open(fpath) as f:
26         pages = list(split_and_escape(f.read()))
27     for i, page in enumerate(pages, 1):
28         tmpl = b'\n' * page.offset + page.content
29         content_type, renderer = parse_specline(page.header)
30         key = 'subject' if i == 1 else content_type
31         env = jinja_env_html if content_type == 'text/html' else jinja_env
32         r[key] = SimplateLoader(fpath, tmpl).load(env, fpath)
33     return r
34
```

Path: `liberapay/constants.py`
Content:
```
1 from __future__ import print_function, unicode_literals
2 
3 from collections import OrderedDict
4 from datetime import date, timedelta
5 from decimal import Decimal
6 import re
7 
8 
9 ASCII_ALLOWED_IN_USERNAME = set("0123456789"
10                                 "abcdefghijklmnopqrstuvwxyz"
11                                 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
12                                 "-_")
13 
14 
15 BIRTHDAY = date(2015, 5, 22)
16 
17 EMAIL_VERIFICATION_TIMEOUT = timedelta(hours=24)
18 EMAIL_RE = re.compile(r'^[^@]+@[^@]+\.[^@]+$')
19 
20 MAX_TIP = Decimal('100.00')
21 MIN_TIP = Decimal('0.01')
22 
23 QUARANTINE = timedelta(weeks=4)
24 
25 PASSWORD_MIN_SIZE = 8
26 PASSWORD_MAX_SIZE = 150
27 
28 _ = lambda a: a
29 PRIVACY_FIELDS = OrderedDict([
30     ('hide_giving', _("Hide total giving from others.")),
31     ('hide_receiving', _("Hide total receiving from others.")),
32     ('hide_from_search', _("Hide myself from search results.")),
33 ])
34 del _
35 PRIVACY_FIELDS_S = ' '.join(PRIVACY_FIELDS.keys())
36 
37 SESSION = b'session'
38 SESSION_REFRESH = timedelta(hours=1)
39 SESSION_TIMEOUT = timedelta(hours=6)
40 
41 USERNAME_MAX_SIZE = 32
42
```

Path: `liberapay/renderers/jinja2_htmlescaped.py`
Content:
```
1 import aspen_jinja2_renderer as base
2 
3 from markupsafe import escape as htmlescape
4 
5 
6 class HTMLRenderer(base.Renderer):
7     def render_content(self, context):
8 
9         # Extend to inject an HTML-escaping function. Since autoescape is on,
10         # template authors shouldn't normally need to use this function, but
11         # having it in the simplate context makes it easier to implement i18n.
12 
13         context['escape'] = context['state']['escape'] = htmlescape
14 
15         return base.Renderer.render_content(self, context)
16 
17 
18 class Factory(base.Factory):
19 
20     Renderer = HTMLRenderer
21 
22     def compile_meta(self, configuration):
23         # Override to turn on autoescaping.
24         loader = base.FileSystemLoader(configuration.project_root)
25         return base.Environment( loader=loader
26                                , autoescape=True
27                                , extensions=['jinja2.ext.autoescape']
28                                 )
29
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/liberapay/constants.py b/liberapay/constants.py
--- a/liberapay/constants.py
+++ b/liberapay/constants.py
@@ -17,6 +17,11 @@
 EMAIL_VERIFICATION_TIMEOUT = timedelta(hours=24)
 EMAIL_RE = re.compile(r'^[^@]+@[^@]+\.[^@]+$')
 
+JINJA_ENV_COMMON = dict(
+    trim_blocks=True, lstrip_blocks=True,
+    line_statement_prefix='%', line_comment_prefix='#',
+)
+
 MAX_TIP = Decimal('100.00')
 MIN_TIP = Decimal('0.01')
 
diff --git a/liberapay/renderers/jinja2_htmlescaped.py b/liberapay/renderers/jinja2_htmlescaped.py
--- a/liberapay/renderers/jinja2_htmlescaped.py
+++ b/liberapay/renderers/jinja2_htmlescaped.py
@@ -2,6 +2,8 @@
 
 from markupsafe import escape as htmlescape
 
+from liberapay.constants import JINJA_ENV_COMMON
+
 
 class HTMLRenderer(base.Renderer):
     def render_content(self, context):
@@ -22,7 +24,8 @@
     def compile_meta(self, configuration):
         # Override to turn on autoescaping.
         loader = base.FileSystemLoader(configuration.project_root)
-        return base.Environment( loader=loader
-                               , autoescape=True
-                               , extensions=['jinja2.ext.autoescape']
-                                )
+        return base.Environment(
+            loader=loader,
+            autoescape=True, extensions=['jinja2.ext.autoescape'],
+            **JINJA_ENV_COMMON
+        )
diff --git a/liberapay/utils/emails.py b/liberapay/utils/emails.py
--- a/liberapay/utils/emails.py
+++ b/liberapay/utils/emails.py
@@ -4,6 +4,8 @@
 from aspen_jinja2_renderer import SimplateLoader
 from jinja2 import Environment
 
+from liberapay.constants import JINJA_ENV_COMMON
+
 
 ( VERIFICATION_MISSING
 , VERIFICATION_FAILED
@@ -14,10 +16,10 @@
  ) = range(6)
 
 
-jinja_env = Environment(trim_blocks=True, lstrip_blocks=True)
+jinja_env = Environment(**JINJA_ENV_COMMON)
 jinja_env_html = Environment(
-    trim_blocks=True, lstrip_blocks=True,
     autoescape=True, extensions=['jinja2.ext.autoescape'],
+    **JINJA_ENV_COMMON
 )
 
 def compile_email_spt(fpath):

{"golden_diff": "diff --git a/liberapay/constants.py b/liberapay/constants.py\n--- a/liberapay/constants.py\n+++ b/liberapay/constants.py\n@@ -17,6 +17,11 @@\n EMAIL_VERIFICATION_TIMEOUT = timedelta(hours=24)\n EMAIL_RE = re.compile(r'^[^@]+@[^@]+\\.[^@]+$')\n \n+JINJA_ENV_COMMON = dict(\n+    trim_blocks=True, lstrip_blocks=True,\n+    line_statement_prefix='%', line_comment_prefix='#',\n+)\n+\n MAX_TIP = Decimal('100.00')\n MIN_TIP = Decimal('0.01')\n \ndiff --git a/liberapay/renderers/jinja2_htmlescaped.py b/liberapay/renderers/jinja2_htmlescaped.py\n--- a/liberapay/renderers/jinja2_htmlescaped.py\n+++ b/liberapay/renderers/jinja2_htmlescaped.py\n@@ -2,6 +2,8 @@\n \n from markupsafe import escape as htmlescape\n \n+from liberapay.constants import JINJA_ENV_COMMON\n+\n \n class HTMLRenderer(base.Renderer):\n     def render_content(self, context):\n@@ -22,7 +24,8 @@\n     def compile_meta(self, configuration):\n         # Override to turn on autoescaping.\n         loader = base.FileSystemLoader(configuration.project_root)\n-        return base.Environment( loader=loader\n-                               , autoescape=True\n-                               , extensions=['jinja2.ext.autoescape']\n-                                )\n+        return base.Environment(\n+            loader=loader,\n+            autoescape=True, extensions=['jinja2.ext.autoescape'],\n+            **JINJA_ENV_COMMON\n+        )\ndiff --git a/liberapay/utils/emails.py b/liberapay/utils/emails.py\n--- a/liberapay/utils/emails.py\n+++ b/liberapay/utils/emails.py\n@@ -4,6 +4,8 @@\n from aspen_jinja2_renderer import SimplateLoader\n from jinja2 import Environment\n \n+from liberapay.constants import JINJA_ENV_COMMON\n+\n \n ( VERIFICATION_MISSING\n , VERIFICATION_FAILED\n@@ -14,10 +16,10 @@\n  ) = range(6)\n \n \n-jinja_env = Environment(trim_blocks=True, lstrip_blocks=True)\n+jinja_env = Environment(**JINJA_ENV_COMMON)\n jinja_env_html = Environment(\n-    trim_blocks=True, lstrip_blocks=True,\n     autoescape=True, extensions=['jinja2.ext.autoescape'],\n+    **JINJA_ENV_COMMON\n )\n \n def compile_email_spt(fpath):\n", "issue": "Switch Jinja templates to line statements\nBecause they're easier to type (especially on an azerty keyboard): `% if ...` instead of `{% if ... %}`. [Documentation](http://jinja.pocoo.org/docs/dev/templates/#line-statements).\n\nAny objections?\n\n", "before_files": [{"content": "from __future__ import unicode_literals\n\nfrom aspen.simplates.pagination import parse_specline, split_and_escape\nfrom aspen_jinja2_renderer import SimplateLoader\nfrom jinja2 import Environment\n\n\n( VERIFICATION_MISSING\n, VERIFICATION_FAILED\n, VERIFICATION_EXPIRED\n, VERIFICATION_REDUNDANT\n, VERIFICATION_STYMIED\n, VERIFICATION_SUCCEEDED\n ) = range(6)\n\n\njinja_env = Environment(trim_blocks=True, lstrip_blocks=True)\njinja_env_html = Environment(\n    trim_blocks=True, lstrip_blocks=True,\n    autoescape=True, extensions=['jinja2.ext.autoescape'],\n)\n\ndef compile_email_spt(fpath):\n    r = {}\n    with open(fpath) as f:\n        pages = list(split_and_escape(f.read()))\n    for i, page in enumerate(pages, 1):\n        tmpl = b'\\n' * page.offset + page.content\n        content_type, renderer = parse_specline(page.header)\n        key = 'subject' if i == 1 else content_type\n        env = jinja_env_html if content_type == 'text/html' else jinja_env\n        r[key] = SimplateLoader(fpath, tmpl).load(env, fpath)\n    return r\n", "path": "liberapay/utils/emails.py"}, {"content": "from __future__ import print_function, unicode_literals\n\nfrom collections import OrderedDict\nfrom datetime import date, timedelta\nfrom decimal import Decimal\nimport re\n\n\nASCII_ALLOWED_IN_USERNAME = set(\"0123456789\"\n                                \"abcdefghijklmnopqrstuvwxyz\"\n                                \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n                                \"-_\")\n\n\nBIRTHDAY = date(2015, 5, 22)\n\nEMAIL_VERIFICATION_TIMEOUT = timedelta(hours=24)\nEMAIL_RE = re.compile(r'^[^@]+@[^@]+\\.[^@]+$')\n\nMAX_TIP = Decimal('100.00')\nMIN_TIP = Decimal('0.01')\n\nQUARANTINE = timedelta(weeks=4)\n\nPASSWORD_MIN_SIZE = 8\nPASSWORD_MAX_SIZE = 150\n\n_ = lambda a: a\nPRIVACY_FIELDS = OrderedDict([\n    ('hide_giving', _(\"Hide total giving from others.\")),\n    ('hide_receiving', _(\"Hide total receiving from others.\")),\n    ('hide_from_search', _(\"Hide myself from search results.\")),\n])\ndel _\nPRIVACY_FIELDS_S = ' '.join(PRIVACY_FIELDS.keys())\n\nSESSION = b'session'\nSESSION_REFRESH = timedelta(hours=1)\nSESSION_TIMEOUT = timedelta(hours=6)\n\nUSERNAME_MAX_SIZE = 32\n", "path": "liberapay/constants.py"}, {"content": "import aspen_jinja2_renderer as base\n\nfrom markupsafe import escape as htmlescape\n\n\nclass HTMLRenderer(base.Renderer):\n    def render_content(self, context):\n\n        # Extend to inject an HTML-escaping function. Since autoescape is on,\n        # template authors shouldn't normally need to use this function, but\n        # having it in the simplate context makes it easier to implement i18n.\n\n        context['escape'] = context['state']['escape'] = htmlescape\n\n        return base.Renderer.render_content(self, context)\n\n\nclass Factory(base.Factory):\n\n    Renderer = HTMLRenderer\n\n    def compile_meta(self, configuration):\n        # Override to turn on autoescaping.\n        loader = base.FileSystemLoader(configuration.project_root)\n        return base.Environment( loader=loader\n                               , autoescape=True\n                               , extensions=['jinja2.ext.autoescape']\n                                )\n", "path": "liberapay/renderers/jinja2_htmlescaped.py"}], "after_files": [{"content": "from __future__ import unicode_literals\n\nfrom aspen.simplates.pagination import parse_specline, split_and_escape\nfrom aspen_jinja2_renderer import SimplateLoader\nfrom jinja2 import Environment\n\nfrom liberapay.constants import JINJA_ENV_COMMON\n\n\n( VERIFICATION_MISSING\n, VERIFICATION_FAILED\n, VERIFICATION_EXPIRED\n, VERIFICATION_REDUNDANT\n, VERIFICATION_STYMIED\n, VERIFICATION_SUCCEEDED\n ) = range(6)\n\n\njinja_env = Environment(**JINJA_ENV_COMMON)\njinja_env_html = Environment(\n    autoescape=True, extensions=['jinja2.ext.autoescape'],\n    **JINJA_ENV_COMMON\n)\n\ndef compile_email_spt(fpath):\n    r = {}\n    with open(fpath) as f:\n        pages = list(split_and_escape(f.read()))\n    for i, page in enumerate(pages, 1):\n        tmpl = b'\\n' * page.offset + page.content\n        content_type, renderer = parse_specline(page.header)\n        key = 'subject' if i == 1 else content_type\n        env = jinja_env_html if content_type == 'text/html' else jinja_env\n        r[key] = SimplateLoader(fpath, tmpl).load(env, fpath)\n    return r\n", "path": "liberapay/utils/emails.py"}, {"content": "from __future__ import print_function, unicode_literals\n\nfrom collections import OrderedDict\nfrom datetime import date, timedelta\nfrom decimal import Decimal\nimport re\n\n\nASCII_ALLOWED_IN_USERNAME = set(\"0123456789\"\n                                \"abcdefghijklmnopqrstuvwxyz\"\n                                \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n                                \"-_\")\n\n\nBIRTHDAY = date(2015, 5, 22)\n\nEMAIL_VERIFICATION_TIMEOUT = timedelta(hours=24)\nEMAIL_RE = re.compile(r'^[^@]+@[^@]+\\.[^@]+$')\n\nJINJA_ENV_COMMON = dict(\n    trim_blocks=True, lstrip_blocks=True,\n    line_statement_prefix='%', line_comment_prefix='#',\n)\n\nMAX_TIP = Decimal('100.00')\nMIN_TIP = Decimal('0.01')\n\nQUARANTINE = timedelta(weeks=4)\n\nPASSWORD_MIN_SIZE = 8\nPASSWORD_MAX_SIZE = 150\n\n_ = lambda a: a\nPRIVACY_FIELDS = OrderedDict([\n    ('hide_giving', _(\"Hide total giving from others.\")),\n    ('hide_receiving', _(\"Hide total receiving from others.\")),\n    ('hide_from_search', _(\"Hide myself from search results.\")),\n])\ndel _\nPRIVACY_FIELDS_S = ' '.join(PRIVACY_FIELDS.keys())\n\nSESSION = b'session'\nSESSION_REFRESH = timedelta(hours=1)\nSESSION_TIMEOUT = timedelta(hours=6)\n\nUSERNAME_MAX_SIZE = 32\n", "path": "liberapay/constants.py"}, {"content": "import aspen_jinja2_renderer as base\n\nfrom markupsafe import escape as htmlescape\n\nfrom liberapay.constants import JINJA_ENV_COMMON\n\n\nclass HTMLRenderer(base.Renderer):\n    def render_content(self, context):\n\n        # Extend to inject an HTML-escaping function. Since autoescape is on,\n        # template authors shouldn't normally need to use this function, but\n        # having it in the simplate context makes it easier to implement i18n.\n\n        context['escape'] = context['state']['escape'] = htmlescape\n\n        return base.Renderer.render_content(self, context)\n\n\nclass Factory(base.Factory):\n\n    Renderer = HTMLRenderer\n\n    def compile_meta(self, configuration):\n        # Override to turn on autoescaping.\n        loader = base.FileSystemLoader(configuration.project_root)\n        return base.Environment(\n            loader=loader,\n            autoescape=True, extensions=['jinja2.ext.autoescape'],\n            **JINJA_ENV_COMMON\n        )\n", "path": "liberapay/renderers/jinja2_htmlescaped.py"}]}