[[Image(https://2.bp.blogspot.com/-JFSh6RRcMbs/XKUCH5KmcMI/AAAAAAAA8TU/ZC-
b4fJJNL0auiAtl2fDSMfBf3nAudhtACEwYBhgL/s1600/unicode%2Berror.png)]]
In the log window, UnicodeDecodeError was continuously printed, and in the
template, the sentence 'A server error occured. Please contact the
administrator' was printed
So when I checked the technical_500.html file of Django 2.2version, I
found that the dotdotdot wrapped by the <span>tag on the 239th line was
changed to ellipsis.
Apparently, the version of Django 2.1.8 was a dotdotdot.
So I took steps to change the 239th line's ellipsis to dotdotdot.
Or, when reading the technical_500.html file from inside the debug.py
file, the encoding format was set to utf-8.
This enabled me to resolve the error.
Did you intentionally modify the technical_html file?
--
Ticket URL: <https://code.djangoproject.com/ticket/30324>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => fixed
--
Ticket URL: <https://code.djangoproject.com/ticket/30324#comment:1>
* status: closed => new
* resolution: fixed =>
--
Ticket URL: <https://code.djangoproject.com/ticket/30324#comment:2>
* owner: (none) => chihun-jang
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/30324#comment:3>
* owner: chihun-jang => Nick Pope
* has_patch: 0 => 1
* easy: 1 => 0
* stage: Unreviewed => Accepted
Comment:
The issue here is that reading the various debug templates was changed in
[https://github.com/django/django/commit/ea542a9c7239b5b665797b7c809f1aceb0b412cf
ea542a9] to bypass the template loaders. The template loaders use the
encoding specified on the template engine which is utf-8 by default. Later
in
[https://github.com/django/django/commit/50b8493581fea3d7137dd8db33bac7008868d23a
50b8493] an ellipsis was added and this caused things to blow up on
Windows as `locale.getpreferredencoding(False)` is not utf-8.
Here is an alternative [https://github.com/django/django/pull/11170 PR]
that adds tests and a release note for 2.2.1 as this is a regression.
--
Ticket URL: <https://code.djangoproject.com/ticket/30324#comment:4>
* severity: Normal => Release blocker
Comment:
Upgrading to Release Blocker. Thanks for the report!
--
Ticket URL: <https://code.djangoproject.com/ticket/30324#comment:5>
Comment (by felixxm):
Original ticket that describes the same issue #30303.
--
Ticket URL: <https://code.djangoproject.com/ticket/30324#comment:6>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/30324#comment:7>
Comment (by Carlton Gibson <carlton.gibson@…>):
In [changeset:"6b4e57d79f49b3dfb297505840663ee13d7cf500" 6b4e57d7]:
{{{
#!CommitTicketReference repository=""
revision="6b4e57d79f49b3dfb297505840663ee13d7cf500"
Refs #30324 -- Forced utf-8 encoding when loading templates for the
technical 404 debug and congrats page.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30324#comment:9>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"efb257a01764855a71051d5bcc7fd66c5ad6d210" efb257a0]:
{{{
#!CommitTicketReference repository=""
revision="efb257a01764855a71051d5bcc7fd66c5ad6d210"
Fixed #30324 -- Forced utf-8 encoding when loading the template for the
technical 500 debug page.
Regression in 50b8493.
Related to ea542a9.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30324#comment:8>
Comment (by Carlton Gibson <carlton.gibson@…>):
In [changeset:"9da25fb832ae9db1a26f3796dcc9df2546d04f2f" 9da25fb]:
{{{
#!CommitTicketReference repository=""
revision="9da25fb832ae9db1a26f3796dcc9df2546d04f2f"
[2.2.x] Fixed #30324 -- Forced utf-8 encoding when loading the template
for the technical 500 debug page.
Regression in 50b8493.
Related to ea542a9.
Backport of efb257a01764855a71051d5bcc7fd66c5ad6d210 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30324#comment:10>
Comment (by zhangplusone):
{{{
<li onclick="toggle('pre{{ frame.id }}', 'post{{ frame.id
}}')"><pre>{{ frame.context_line }}</pre>{% if not is_email %}
<span>…</span>{% endif %}</li>
}}}
On line 239, there is a special characters "…", or you can replace it with
"..."
--
Ticket URL: <https://code.djangoproject.com/ticket/30324#comment:11>