/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/osutils.py

  • Committer: Andrew Bennetts
  • Date: 2008-09-22 04:48:47 UTC
  • mfrom: (3719 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3721.
  • Revision ID: andrew.bennetts@canonical.com-20080922044847-ad1y8ibge3s2ak4i
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1425
1425
        return _cached_user_encoding
1426
1426
 
1427
1427
    if sys.platform == 'darwin':
1428
 
        # work around egregious python 2.4 bug
 
1428
        # python locale.getpreferredencoding() always return
 
1429
        # 'mac-roman' on darwin. That's a lie.
1429
1430
        sys.platform = 'posix'
1430
1431
        try:
 
1432
            if os.environ.get('LANG', None) is None:
 
1433
                # If LANG is not set, we end up with 'ascii', which is bad
 
1434
                # ('mac-roman' is more than ascii), so we set a default which
 
1435
                # will give us UTF-8 (which appears to work in all cases on
 
1436
                # OSX). Users are still free to override LANG of course, as
 
1437
                # long as it give us something meaningful. This work-around
 
1438
                # *may* not be needed with python 3k and/or OSX 10.5, but will
 
1439
                # work with them too -- vila 20080908
 
1440
                os.environ['LANG'] = 'en_US.UTF-8'
1431
1441
            import locale
1432
1442
        finally:
1433
1443
            sys.platform = 'darwin'