The problematic template is TECHNICAL_500_TEXT_TEMPLATE in
django/views/debug.py:
https://github.com/django/django/blob/master/django/views/debug.py#L1121
Specially this code:
{{{
Using settings module {{ settings.SETTINGS_MODULE }}{% for k, v in
settings.items|dictsort:0 %}
{{ k }} = {{ v|stringformat:"r" }}{% endfor %}
}}}
I think best approach would be to use pformat for formatting those entries
same as is used for request parameters.
--
Ticket URL: <https://code.djangoproject.com/ticket/26496>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_docs: => 0
* needs_tests: => 0
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/26496#comment:1>
* easy: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/26496#comment:2>
* owner: => filias
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/26496#comment:3>
* owner: filias =>
* status: assigned => new
--
Ticket URL: <https://code.djangoproject.com/ticket/26496#comment:4>
* owner: => SachitNayak
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/26496#comment:5>
* owner: SachitNayak =>
* status: assigned => new
Comment:
Since there hasn't been progress in the 5 weeks since this ticket was
assigned, I'm de-assigning it to free it up for a PyCon sprinter.
--
Ticket URL: <https://code.djangoproject.com/ticket/26496#comment:6>
* status: new => assigned
* owner: => knightrix
--
Ticket URL: <https://code.djangoproject.com/ticket/26496#comment:7>
* status: assigned => closed
* resolution: => fixed
Comment:
It looks like this is fixed by #22561. I modified the test like below and
it passed for the use case.
{{{#!python
def test_send_long_lines(self):
email = EmailMessage('Subject', "Commentçava},{'this': {'another':
{'more': 'nested'}, 'inner': 'myinner'}, 'that': 'hi'}" * 100,
'fr...@example.com', ['t...@example.com'])
email.send()
message = self.get_the_message()
message_content = message.get_payload()
has_long_lines = any(len(l) > 998 for l in
message_content.splitlines())
self.assertFalse(has_long_lines)
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26496#comment:8>
Comment (by timgraham):
More friendly formatting of dictionaries may still be useful if someone is
so inclined to reopen the ticket and make that change.
--
Ticket URL: <https://code.djangoproject.com/ticket/26496#comment:9>