django.utils.text.smart_split() does not properly handle unmatched quotes
|Reported by:||Owned by:||Adrian Holovaty|
|Cc:||serg@…||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
django.utils.text.smart_split() does not properly handle unmatched quotes.
smart_split() eats up last character of the word that begins with an unmatched quote and that quote character itself:
>> text.smart_split("one 'two three") ['one', 'tw', 'three']
Of course unmatched quote in a tag argument string most probably is an error. But result produced by smart_split() (
"'two" -> "tw") doesn't leave chances to notice or detect this error until actual use at render time (and may be even further).
Also smart_split()'s doctest still produce syntax error (in spite of #3035).