﻿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
35395	slice filter crashes on an empty dict with Python 3.12	Tim Richardson	Tim Richardson	"I have a template with a fragment like this:


`<span class=""fs-6"">Supplier: {{ po_metadata|get_item:dict_item.PONumber|get_item:""supplier"" }} PO Date: {{ po_metadata|get_item:dict_item.PONumber|get_item:""order_date"" | slice:"":10"" }} </span>`


When using python 3.13.2, I get an exception in django/template/defaultfilters.py  slice_filter()

This code does not throw an exception with 3.11

The exception is a Key Error and it happens because instead a list being passed to the filter, a dictionary is. An empty dict in my case. 

In python 3.11, the breakpoints  in slice_filter() are not hit. Somehow the preceeding filters are behaving differently in case of po_metadata being an empty  dict."	Bug	closed	Template system	4.2	Normal	fixed			Ready for checkin	1	0	0	0	1	0
