#24045: Useless calls to mark_safe and mark_for_escaping
--------------------------------------+------------------------------------
Reporter: aaugustin | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Core (Other) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by timgraham):
* has_patch: 0 => 1
* stage: Unreviewed => Accepted
Comment:
For 1, the code in question in `trans_null.py` was introduced in
64c0bf86775c5706355c9d3870345b8cff2c63f4. It looks like it could have been
removed as part of 2779c299c8b7e4556b5285acc86d17560522e702.
[https://github.com/django/django/pull/3785 PR] for that.
For 2, outside of the `escape_filter`, the only usage of
`mark_for_escaping` seems to be in
[https://github.com/django/django/blob/5dddd79433ceb88ab67d9851b49a44ce5b8f509c/django/template/base.py#L624-L625
template/base.py] which checks `isinstance(obj, EscapeData)` but calls
`mark_for_escaping(new_obj)` so it doesn't seem redundant.
Let me know if I've missed something or should do further auditing.
--
Ticket URL: <https://code.djangoproject.com/ticket/24045#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/067.e2374983c9020856fabe6349a21e72e9%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.