[meld/meld-1-8] Decode user data dir paths so that unicode usernames don't blow up



commit 8b6b155e382a2f43f811cc9564a300b5973abca1
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sat Oct 12 08:03:52 2013 +1000

    Decode user data dir paths so that unicode usernames don't blow up
    
    This isn't really properly fixable until GTK 3, as things we want
    access to aren't bound in support pygtk.

 meld/recent.py     |    1 +
 meld/util/prefs.py |    3 ++-
 2 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/meld/recent.py b/meld/recent.py
index 54284b3..430dc2c 100644
--- a/meld/recent.py
+++ b/meld/recent.py
@@ -49,6 +49,7 @@ COMPARISON_TYPES = (TYPE_FILE, TYPE_FOLDER, TYPE_VC, TYPE_MERGE)
 class RecentFiles(object):
 
     recent_path = os.path.join(glib.get_user_data_dir(), "meld")
+    recent_path = recent_path.decode('utf8')
     recent_suffix = ".meldcmp"
 
     # Recent data
diff --git a/meld/util/prefs.py b/meld/util/prefs.py
index 8cd616e..891f793 100644
--- a/meld/util/prefs.py
+++ b/meld/util/prefs.py
@@ -189,7 +189,8 @@ class ConfigParserPreferences(object):
         }
 
         if sys.platform == "win32":
-            pref_dir = os.path.join(os.getenv("APPDATA"), "Meld")
+            config_dir = glib.get_user_config_dir().decode('utf8')
+            pref_dir = os.path.join(config_dir, "Meld")
         else:
             pref_dir = os.path.join(glib.get_user_config_dir(), "meld")
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]