#10335: tzinfo.py should use getdefaultencoding instead of getdefaultlocale[1]
-------------------------------------+--------------------------------------
          Reporter:  gthb            |         Owner:  nobody                   
                              
            Status:  new             |     Milestone:                           
                              
         Component:  Core framework  |       Version:  1.0                      
                              
        Resolution:                  |      Keywords:  locale encoding 
getdefaultlocale getdefaultencoding mac
             Stage:  Unreviewed      |     Has_patch:  1                        
                              
        Needs_docs:  0               |   Needs_tests:  0                        
                              
Needs_better_patch:  0               |  
-------------------------------------+--------------------------------------
Changes (by gthb):

  * keywords:  locale encoding getdefaultlocale => locale encoding
               getdefaultlocale getdefaultencoding mac
  * needs_better_patch:  => 0
  * needs_tests:  => 0
  * needs_docs:  => 0

Comment:

 I attached a patch against trunk for the simplest change, just using
 sys.getdefaultencoding() instead of locale.getdefaultlocale()[1]. I ran
 the test suite before and after. Before, I got hordes of errors almost all
 of which included the words "unknown encoding: mac-icelandic". After, I
 got only this:

 {{{
 ======================================================================
 FAIL: Doctest: regressiontests.model_regress.models.__test__.API_TESTS
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "/Users/gthb/Library/Python/2.5/site-
 packages/django/test/_doctest.py", line 2180, in runTest
     raise self.failureException(self.format_failure(new.getvalue()))
 AssertionError: Failed doctest test for
 regressiontests.model_regress.models.__test__.API_TESTS
   File "/Users/gthb/extsvn/django-
 trunk/tests/regressiontests/model_regress/models.py", line unknown line
 number, in API_TESTS

 ----------------------------------------------------------------------
 File "/Users/gthb/extsvn/django-
 trunk/tests/regressiontests/model_regress/models.py", line ?, in
 regressiontests.model_regress.models.__test__.API_TESTS
 Failed example:
     BrokenUnicodeMethod.objects.all()
 Expected:
     [<BrokenUnicodeMethod: [Bad Unicode data]>]
 Got:
     [<BrokenUnicodeMethod: Názov: Jerry>]
 }}}

 ... which I also got when running the test suite on unchanged django
 trunk.

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