#3459: encoding related test case failure on Mac OS X
---------------------+------------------------------------------------------
 Reporter:  cboos    |        Owner:  cboos
     Type:  defect   |       Status:  new  
 Priority:  high     |    Milestone:  0.10 
Component:  general  |      Version:  devel
 Severity:  normal   |   Resolution:       
 Keywords:           |  
---------------------+------------------------------------------------------
Comment (by cboos):

 Replying to [comment:1 eblot]:
 > ... the first "bug" is due to the default encoding of the terminal test
 scripts are running in. If the terminal locale is configured to use UTF-8,
 the first issue disappears. ...

 Can you try the following patch?
 {{{
 Index: trac/scripts/tests/admin.py
 ===================================================================
 --- trac/scripts/tests/admin.py (revision 3566)
 +++ trac/scripts/tests/admin.py (working copy)
 @@ -118,7 +118,7 @@
              _err = sys.stderr
              _out = sys.stdout
              sys.stderr = sys.stdout = out = StringIO()
 -            setattr(out, 'encoding', _out.encoding) # fake output
 encoding
 +            setattr(out, 'encoding', 'utf-8') # fake output encoding
              retval = None
              try:
                  retval = self._admin.onecmd(cmd)
 @@ -126,7 +126,7 @@
                  pass
              value = out.getvalue()
              if isinstance(value, str): # reverse what print_listing did
 -                value = value.decode(_out.encoding)
 +                value = value.decode('utf-8')
              if strip_trailing_space:
                  return retval, STRIP_TRAILING_SPACE.sub('', value)
              else:
 }}}

-- 
Ticket URL: <http://trac.edgewall.org/ticket/3459#comment:3>
The Trac Project <http://trac.edgewall.com/>
_______________________________________________
Trac-Tickets mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac-tickets

Reply via email to