#6353: debug.technical_500_response fails on exceptions having localized text in
unicode
---------------------------------------------+------------------------------
          Reporter:  [EMAIL PROTECTED]  |         Owner:  mtredinnick
            Status:  reopened                |     Milestone:  1.0        
         Component:  Core framework          |       Version:  SVN        
        Resolution:                          |      Keywords:             
             Stage:  Accepted                |     Has_patch:  1          
        Needs_docs:  0                       |   Needs_tests:  0          
Needs_better_patch:  0                       |  
---------------------------------------------+------------------------------
Comment (by mtredinnick):

 Karen, doing blanket coverage of exception classes in `force_unicode()`
 will disguise real bugs. The two problems you report are both cases of
 exceptions being poorly constructed -- in the first case your example
 simply doesn't work in Python (and hence in Django), in the second case,
 there's some extra work potentially needed in the `Http404` exception
 class. An exception class must be able to be displayed with its `__str__`
 method, because that's how Python does it. So we need to make sure that if
 we're passing non-ASCII data into particular exception classes, they have
 a `__str__` method which can display the right data.

 Django should remain faithful to Python's default behaviour there -- if
 you do something that isn't valid in Python, it shouldn't suddenly become
 valid just because Django was in the middle. Hiding the problem inside
 `force_unicode()` runs contrary to that. That's why we chose to fix this
 for the specific problem reported in the ticket (unfortunately, it turns
 out that other problems were reported in the comments and these were
 overlooked, so thanks for your diligence in preparing a summary of the
 issues).

 I think the only thing remaining to do to close this off is fixing
 `Http404` with a decent `__str__` method and then doing a quick audit of
 our other exception classes. People can then open tickets for any specific
 cases we may miss.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/6353#comment:15>
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