~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/win32utils.py

  • Committer: Martin Packman
  • Date: 2012-01-05 10:44:12 UTC
  • mfrom: (6424 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6427.
  • Revision ID: martin.packman@canonical.com-20120105104412-z03fi9m43h946fvs
Merge bzr.dev to resolve conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
Only one dependency: ctypes should be installed.
20
20
"""
21
21
 
 
22
from __future__ import absolute_import
 
23
 
22
24
import glob
23
25
import operator
24
26
import os
370
372
    return get_environ_unicode('COMPUTERNAME')
371
373
 
372
374
 
373
 
@symbol_versioning.deprecated_method(
 
375
@symbol_versioning.deprecated_function(
374
376
    symbol_versioning.deprecated_in((2, 5, 0)))
375
377
def _ensure_unicode(s):
376
378
    if s and type(s) != unicode:
379
381
    return s
380
382
 
381
383
 
382
 
get_appdata_location_unicode = symbol_versioning.deprecated_method(
 
384
get_appdata_location_unicode = symbol_versioning.deprecated_function(
383
385
    symbol_versioning.deprecated_in((2, 5, 0)))(get_appdata_location)
384
386
 
385
 
get_home_location_unicode = symbol_versioning.deprecated_method(
 
387
get_home_location_unicode = symbol_versioning.deprecated_function(
386
388
    symbol_versioning.deprecated_in((2, 5, 0)))(get_home_location)
387
389
 
388
 
get_user_name_unicode = symbol_versioning.deprecated_method(
 
390
get_user_name_unicode = symbol_versioning.deprecated_function(
389
391
    symbol_versioning.deprecated_in((2, 5, 0)))(get_user_name)
390
392
 
391
 
get_host_name_unicode = symbol_versioning.deprecated_method(
 
393
get_host_name_unicode = symbol_versioning.deprecated_function(
392
394
    symbol_versioning.deprecated_in((2, 5, 0)))(get_host_name)
393
395
 
394
396
 
592
594
 
593
595
        Fallback version that should basically never be needed.
594
596
        """
 
597
        from bzrlib import osutils
595
598
        try:
596
 
            return os.environ[key].decode("mbcs")
 
599
            return os.environ[key].decode(osutils.get_user_encoding())
597
600
        except KeyError:
598
601
            return default
599
602