smart_split behaviour is surprising
|Reported by:||steveire||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:1 Changed 5 years ago by russellm
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted
Changed 5 years ago by ersame
comment:2 Changed 5 years ago by ersame
- Has patch set
comment:4 Changed 5 years ago by ersame
- Triage Stage changed from Accepted to Design decision needed