#15093: smart_split behaviour is surprising
-----------------------------+----------------------------------------------
 Reporter:  steveire         |       Owner:  nobody    
   Status:  new              |   Milestone:            
Component:  Template system  |     Version:  1.2       
 Keywords:                   |       Stage:  Unreviewed
Has_patch:  0                |  
-----------------------------+----------------------------------------------
 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 [1]: from django.utils.text import smart_split

 In [2]: smart_split(' now "j "n" Y"'
    ...: )
 Out[2]: <generator object smart_split at 0xa0f5d74>

 In [3]: for a in smart_split(' now "j "n" Y"'): print a
    ...:
 now
 "j "n" Y"

 In [4]: for a in smart_split(' now "j " n " Y"'): print a
    ...:
 now
 "j "
 n
 " Y"
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/15093>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to