﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
21741	render_to_string without providing a dictionary still puts a dictionary into the context	Keryn Knight <django@…>	Martin Matusiak	"given the following scenario:
{{{
>>> from django.template.loader import render_to_string
>>> from django.template import Context
>>> render_to_string('file.extension', context_instance=Context())
>>> # or ...
>>> render_to_string('file.extension')
}}}
where a dictionary is explicitly not being provided, the final context given to the template when `render()` is called will have `{}` as the last of the `.dicts`

The reason is because if [https://github.com/django/django/blob/fe995e6cbdcf2766cf0aa951c8ef4549ad27694c/django/template/loader.py#L167 none is provided], a new dict is created, and then it is provided to the context instance ([https://github.com/django/django/blob/fe995e6cbdcf2766cf0aa951c8ef4549ad27694c/django/template/loader.py#L173 1], [https://github.com/django/django/blob/fe995e6cbdcf2766cf0aa951c8ef4549ad27694c/django/template/loader.py#L176 2]) without checking the dict's `len()`

Marking as cleanup/optimization because it doesn't cause any problems (the only one being: it appears in debug_toolbar), but providing the ticket at least means the option is there to change it, and a history of why not to change it exists if ''wontfix'd'' (which may be the best course of action, on balance, but that's not for me to say)"	Cleanup/optimization	closed	Template system	dev	Normal	fixed	nlsprint14		Accepted	0	0	0	0	0	0
