smart_split behaviour is surprising
|Reported by:||Stephen Kelly||Owned by:||nobody|
|Cc:||Triage Stage:||Design decision needed|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I attempted to fix #15092 with a smart_split and noticed that it does not split on unescaped " not surrounded by whitespace.
If this is intentional it should be documented. I don't think any other unit test for templates tries to use a 'corrupt' string like that.
It seems that FilterExpression doesn't accept strings like that anyway, so it should either be documented that they don't work in the template system, or smart_split should be changed.
In : from django.utils.text import smart_split In : smart_split(' now "j "n" Y"' ...: ) Out: <generator object smart_split at 0xa0f5d74> In : for a in smart_split(' now "j "n" Y"'): print a ...: now "j "n" Y" In : for a in smart_split(' now "j " n " Y"'): print a ...: now "j " n " Y"
Change History (10)
comment:4 Changed 6 years ago by
|Triage Stage:||Accepted → Design decision needed|