#3582: Newforms tests fail under Python2.3 -- unicode related
------------------------------------------------+---------------------------
   Reporter:  jacob                             |                Owner:  adrian 
        
     Status:  new                               |            Component:  
django.newforms
    Version:  SVN                               |           Resolution:         
        
   Keywords:  newforms unicode python2.3 tests  |                Stage:  
Accepted       
  Has_patch:  0                                 |           Needs_docs:  0      
        
Needs_tests:  0                                 |   Needs_better_patch:  0      
        
------------------------------------------------+---------------------------
Comment (by mtredinnick):

 I've eventualy managed to track down the cause of this problem: it's
 caused by
 
[https://sourceforge.net/tracker/?func=detail&atid=105470&aid=964929&group_id=5470
 this Python bug]. String interpolation into unicode strings wasn't being
 done correctly in Python 2.3.
 
 The fix in this particular case is that line 374 of newforms/widgets.py
 has to change from
 {{{
 #!python
 return u'<ul>\n%s\n</ul>' % u'\n'.join([u'<li>%s</li>' % w for w in self])
 }}}
 to
 {{{
 #!python
 return u'<ul>\n%s\n</ul>' % u'\n'.join([u'<li>%s</li>' % unicode(w) for w
 in self])
 }}}
 
 The bad news is that there are a '''lot''' of places we are wanting to use
 this type of construction, particularly in the unicode branch. Having to
 wrap unicode() calls around all the arguments is going to be painful and
 slow things down (one extra function call for each variable argument in a
 lot of unicode string interpolations).
 
 Not committing the fix right now because I'm a bit tired and want to think
 if there's a nicer fix (in general) that I've missed.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/3582#comment:3>
Django Code <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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to