aboutsummaryrefslogtreecommitdiff
path: root/src/Config.py
diff options
context:
space:
mode:
authorGravatar jesopo2020-02-24 15:24:39 +0000
committerGravatar jesopo2020-02-24 15:24:39 +0000
commit175c0a285c0eba508fd4b93b3d858e73985339e6 (patch)
tree783e22ccfe51c3bd92c1b53d741e683c13298545 /src/Config.py
parentuse "latin-1" consitently (not "iso-8859-1") (diff)
signature
open possibly-utf8 files with forced utf8
Diffstat (limited to 'src/Config.py')
-rw-r--r--src/Config.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Config.py b/src/Config.py
index 06926dbb..e2449cc5 100644
--- a/src/Config.py
+++ b/src/Config.py
@@ -1,4 +1,5 @@
import collections, configparser, os, typing
+from src import utils
class Config(object):
def __init__(self, name: str, location: str):
@@ -11,7 +12,7 @@ class Config(object):
def load(self):
if os.path.isfile(self.location):
- with open(self.location) as config_file:
+ with utils.io.open(self.location, "r") as config_file:
parser = self._parser()
parser.read_string(config_file.read())
self._config.clear()
@@ -20,7 +21,7 @@ class Config(object):
self._config[k] = v
def save(self):
- with open(self.location, "w") as config_file:
+ with utils.io.open(self.location, "w") as config_file:
parser = self._parser()
parser[self._name] = self._config.copy()
parser.write(config_file)