From 9d5a2a1c86bffc0895754badbd48746f481cdad2 Mon Sep 17 00:00:00 2001 From: Orakaro Date: Thu, 31 Jul 2014 09:38:37 +0900 Subject: [PATCH] json save and load without utf-8 --- docs/conf.py | 4 ++-- rainbowstream/config.py | 6 +++--- setup.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) 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 = [ -- 2.25.1