On Friday 02 June 2017 18:38:47 Vlastimil Zíma wrote:
> 
> Shai: Values are sometimes turned into an empty string in case of
> UnicodeDecodeError, see
> https://github.com/django/django/blob/master/django/template/base.py#L994-L
> 998
> 

That code is within a render() method -- a place where the value is already 
going to be turned into a string.

> IMO invalid variable should behave the same way regardless of whether it's
> printed or used as an filter argument.
> 

My point was that rendering makes a difference because it already implies a 
possible type change.

I stand by my earlier position: Changing a filter argument to a string is odd 
and unexpected and we shouldn't do this. We should either keep raising an 
exception, or replace the whole filter expression (rather than just the 
argument) with string_if_invalid. My preference is towards the exception, but 
I also see the value of failing silently here.

Shai.

Reply via email to