/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_osutils.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-09-05 08:48:24 UTC
  • mfrom: (2785.1.7 show-version)
  • Revision ID: pqm@pqm.ubuntu.com-20070905084824-xdwd8f4fioovdi9v
bugfix #131100: bzr --version should care about encoding of stdout
 (bialix,r=ianc)

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
        pathjoin,
36
36
        )
37
37
from bzrlib.tests import (
 
38
        probe_unicode_in_user_encoding,
38
39
        StringIOWrapper,
39
40
        TestCase,
40
41
        TestCaseInTempDir,
1001
1002
        
1002
1003
        So Unicode strings must be encoded.
1003
1004
        """
1004
 
        # Try a few different characters, to see if we can get
1005
 
        # one that will be valid in the user_encoding
1006
 
        possible_vals = [u'm\xb5', u'\xe1', u'\u0410']
1007
 
        for uni_val in possible_vals:
1008
 
            try:
1009
 
                env_val = uni_val.encode(bzrlib.user_encoding)
1010
 
            except UnicodeEncodeError:
1011
 
                # Try a different character
1012
 
                pass
1013
 
            else:
1014
 
                break
1015
 
        else:
 
1005
        uni_val, env_val = probe_unicode_in_user_encoding()
 
1006
        if uni_val is None:
1016
1007
            raise TestSkipped('Cannot find a unicode character that works in'
1017
1008
                              ' encoding %s' % (bzrlib.user_encoding,))
1018
1009