summarylogtreecommitdiffstats
path: root/0001-plugin-API-Open-preference-file-for-reading-as-binar.patch
blob: 5330fde41e3dc2032dd78f9f02f6b3e2cee1dfef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From 767bfca97a931def28d354d18c1ec3541779ff59 Mon Sep 17 00:00:00 2001
From: Olivier Mehani <shtrom+gtg@ssji.net>
Date: Wed, 18 Jun 2014 09:46:31 +1000
Subject: [PATCH] [plugin API] Open preference file for reading as binary

Otherwise, the file is not readable as such when reloading, and the
plugin (e.g., Hamster integration) always uses the defaults.

Signed-off-by: Olivier Mehani <shtrom+gtg@ssji.net>
---
 GTG/core/plugins/api.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/GTG/core/plugins/api.py b/GTG/core/plugins/api.py
index 6e881f4..09c3f4f 100644
--- a/GTG/core/plugins/api.py
+++ b/GTG/core/plugins/api.py
@@ -237,7 +237,7 @@ class PluginAPI:
         if os.path.isdir(dirname):
             if os.path.isfile(path):
                 try:
-                    with open(path, 'r') as file:
+                    with open(path, 'rb') as file:
                         item = pickle.load(file)
                         config.update(item)
                 except:
-- 
2.0.0