[meld] ui.historyentry: Don't use SafeConfigParser's interpolation (bgo#757659)



commit 7dcfef038ed9dbac7d17f2f36d1039995db32873
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sat Nov 7 07:22:55 2015 +1000

    ui.historyentry: Don't use SafeConfigParser's interpolation (bgo#757659)
    
    SafeConfigParser and ConfigParser both support magical interpolation
    syntax that we don't use. Better yet, these classes will happily write
    out values that they can't read back in, and traceback when you try.
    
    Specifically, in this case a commit message containing "%PARAM1%" broke
    the parsers because they considered this to be an invalid interpolation
    string, but only errored the *next* time you tried to change the config
    file.
    
    This commit just moves us to using RawConfigParser because we don't
    want the magical behaviour.

 meld/ui/historyentry.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/meld/ui/historyentry.py b/meld/ui/historyentry.py
index 49ee699..5cf6587 100644
--- a/meld/ui/historyentry.py
+++ b/meld/ui/historyentry.py
@@ -88,7 +88,7 @@ class HistoryCombo(Gtk.ComboBox):
             os.makedirs(pref_dir)
 
         self.history_file = os.path.join(pref_dir, "history.ini")
-        self.config = configparser.SafeConfigParser()
+        self.config = configparser.RawConfigParser()
         if os.path.exists(self.history_file):
             self.config.read(self.history_file)
 


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