Rev 5601: (jameinel) Decode config_dir() environment variables on Windows using 'mbcs' in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Wed Jan 12 19:14:43 UTC 2011


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 5601 [merge]
revision-id: pqm at pqm.ubuntu.com-20110112191441-mvbtkj06k4rkmifl
parent: pqm at pqm.ubuntu.com-20110112183925-rnn12p6xp91441r0
parent: john at arbash-meinel.com-20110112181258-h6y0zroiglo0whx1
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2011-01-12 19:14:41 +0000
message:
  (jameinel) Decode config_dir() environment variables on Windows using 'mbcs'
   (John A Meinel)
modified:
  bzrlib/config.py               config.py-20051011043216-070c74f4e9e338e8
=== modified file 'bzrlib/config.py'
--- a/bzrlib/config.py	2010-11-29 01:23:53 +0000
+++ b/bzrlib/config.py	2011-01-12 18:12:58 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2005-2010 Canonical Ltd
+# Copyright (C) 2005-2011 Canonical Ltd
 #   Authors: Robert Collins <robert.collins at canonical.com>
 #            and others
 #
@@ -1131,10 +1131,16 @@
     """
     base = os.environ.get('BZR_HOME', None)
     if sys.platform == 'win32':
+        # environ variables on Windows are in user encoding/mbcs. So decode
+        # before using one
+        if base is not None:
+            base = base.decode('mbcs')
         if base is None:
             base = win32utils.get_appdata_location_unicode()
         if base is None:
             base = os.environ.get('HOME', None)
+            if base is not None:
+                base = base.decode('mbcs')
         if base is None:
             raise errors.BzrError('You must have one of BZR_HOME, APPDATA,'
                                   ' or HOME set')




More information about the bazaar-commits mailing list