~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/win32utils.py

(gz) Fix deprecations of win32utils path function unicode wrappers (Martin
 Packman)

Show diffs side-by-side

added added

removed removed

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