summaryrefslogtreecommitdiff
path: root/django/views/debug.py
diff options
context:
space:
mode:
authorNick Pope <nick.pope@flightdataservices.com>2019-04-05 14:45:41 +0200
committerCarlton Gibson <carlton.gibson@noumenal.es>2019-04-05 16:35:01 +0200
commit6b4e57d79f49b3dfb297505840663ee13d7cf500 (patch)
tree4d9d78f1ef6442b3c8ee3d1ae4e136c943dc5c15 /django/views/debug.py
parentefb257a01764855a71051d5bcc7fd66c5ad6d210 (diff)
Refs #30324 -- Forced utf-8 encoding when loading templates for the technical 404 debug and congrats page.
Diffstat (limited to 'django/views/debug.py')
-rw-r--r--django/views/debug.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/views/debug.py b/django/views/debug.py
index 18e961aa55..cb3e8c7ec1 100644
--- a/django/views/debug.py
+++ b/django/views/debug.py
@@ -497,7 +497,7 @@ def technical_404_response(request, exception):
module = obj.__module__
caller = '%s.%s' % (module, caller)
- with Path(CURRENT_DIR, 'templates', 'technical_404.html').open() as fh:
+ with Path(CURRENT_DIR, 'templates', 'technical_404.html').open(encoding='utf-8') as fh:
t = DEBUG_ENGINE.from_string(fh.read())
c = Context({
'urlconf': urlconf,
@@ -514,7 +514,7 @@ def technical_404_response(request, exception):
def default_urlconf(request):
"""Create an empty URLconf 404 error response."""
- with Path(CURRENT_DIR, 'templates', 'default_urlconf.html').open() as fh:
+ with Path(CURRENT_DIR, 'templates', 'default_urlconf.html').open(encoding='utf-8') as fh:
t = DEBUG_ENGINE.from_string(fh.read())
c = Context({
'version': get_docs_version(),