diff --git a/jd4/config.py b/jd4/config.py index c9464d6..214876a 100644 --- a/jd4/config.py +++ b/jd4/config.py @@ -13,7 +13,7 @@ def _load_config(): try: - with open(_CONFIG_FILE, 'r', encoding='utf-8') as file: + with open(_CONFIG_FILE, 'rb') as file: return yaml.load(file, Loader=yaml.RoundTripLoader) except FileNotFoundError: logger.error('Config file %s not found.', _CONFIG_FILE) @@ -29,7 +29,7 @@ def _load_config(): async def save_config(): def do_save_config(): - with open(_CONFIG_FILE, 'w') as file: + with open(_CONFIG_FILE, 'wb') as file: yaml.dump(config, file, Dumper=yaml.RoundTripDumper) await get_event_loop().run_in_executor(None, do_save_config)