fix small bug
[rainbowstream.git] / rainbowstream / config.py
index 860646d78ca29f62375fac264246733a2b699b15..2a11d3bdc9ea36c23d64d172ef4c73d2f910a28f 100644 (file)
@@ -2,7 +2,6 @@ import json
 import re
 import os
 import os.path
-from io import open
 from collections import OrderedDict
 
 # Regular expression for comments in config file
@@ -30,7 +29,7 @@ def load_config(filepath):
     """
     Load config from filepath
     """
-    with open(filepath, encoding='utf-8') as f:
+    with open(filepath) as f:
         content = ''.join(f.readlines())
         match = comment_re.search(content)
         while match:
@@ -98,7 +97,7 @@ def set_config(key, value):
     else:
         data[key] = value
     # Save
-    with open(path, 'w', encoding='utf-8') as out:
+    with open(path, 'w') as out:
         json.dump(data, out, indent=4)
     os.system('chmod 777 ' + path)
 
@@ -120,7 +119,7 @@ def delete_config(key):
     else:
         raise Exception('No such config key.')
     # Save
-    with open(path, 'w', encoding='utf-8') as out:
+    with open(path, 'w') as out:
         json.dump(data, out, indent=4)
     os.system('chmod 777 ' + path)