From: Orakaro Date: Thu, 31 Jul 2014 00:38:37 +0000 (+0900) Subject: json save and load without utf-8 X-Git-Url: https://vcs.fsf.org/?p=rainbowstream.git;a=commitdiff_plain;h=9d5a2a1c86bffc0895754badbd48746f481cdad2;hp=d95839b6c08e4ebf2a1704bb5d4bcd3dfe95e3ef json save and load without utf-8 --- diff --git a/docs/conf.py b/docs/conf.py index a94a094..7d6f76a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -51,9 +51,9 @@ copyright = u'2014, Vu Nhat Minh' # built documents. # # The short X.Y version. -version = '0.5.7' +version = '0.5.8' # The full version, including alpha/beta/rc tags. -release = '0.5.7' +release = '0.5.8' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/rainbowstream/config.py b/rainbowstream/config.py index 860646d..e6c0de2 100644 --- a/rainbowstream/config.py +++ b/rainbowstream/config.py @@ -30,7 +30,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 +98,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 +120,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) diff --git a/setup.py b/setup.py index f671f49..da93a01 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ import os.path import sys # Bumped version -version = '0.5.7' +version = '0.5.8' # Require install_requires = [