~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/win32utils.py

  • Committer: Vincent Ladeuil
  • Date: 2011-12-16 16:38:33 UTC
  • mto: This revision was merged to the branch mainline in revision 6387.
  • Revision ID: v.ladeuil+lp@free.fr-20111216163833-4igwmwi1dmxbbebw
Migrate add.maximum_file_size to the new config scheme

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