Skip to content

Commit e1c85ca

Browse files
committed
fix #483
1 parent 4e83e79 commit e1c85ca

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

fastcore/foundation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ def save_config_file(file, d, **kwargs):
243243
# %% ../nbs/02_foundation.ipynb 130
244244
def read_config_file(file, **kwargs):
245245
config = ConfigParser(**kwargs)
246-
config.read(file)
246+
config.read(file, encoding='utf8')
247247
return config['DEFAULT']
248248

249249
# %% ../nbs/02_foundation.ipynb 133
@@ -255,7 +255,7 @@ def __init__(self, cfg_path, cfg_name, create=None, save=True, extra_files=None,
255255
self.config_path,self.config_file = cfg_path,cfg_path/cfg_name
256256
self._cfg = ConfigParser()
257257
self.d = self._cfg['DEFAULT']
258-
found = [Path(o) for o in self._cfg.read(L(extra_files)+[self.config_file])]
258+
found = [Path(o) for o in self._cfg.read(L(extra_files)+[self.config_file], encoding='utf8')]
259259
if self.config_file not in found and create is not None:
260260
self._cfg.read_dict({'DEFAULT':create})
261261
if save:

nbs/02_foundation.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2209,7 +2209,7 @@
22092209
"#|export\n",
22102210
"def read_config_file(file, **kwargs):\n",
22112211
" config = ConfigParser(**kwargs)\n",
2212-
" config.read(file)\n",
2212+
" config.read(file, encoding='utf8')\n",
22132213
" return config['DEFAULT']"
22142214
]
22152215
},
@@ -2264,7 +2264,7 @@
22642264
" self.config_path,self.config_file = cfg_path,cfg_path/cfg_name\n",
22652265
" self._cfg = ConfigParser()\n",
22662266
" self.d = self._cfg['DEFAULT']\n",
2267-
" found = [Path(o) for o in self._cfg.read(L(extra_files)+[self.config_file])]\n",
2267+
" found = [Path(o) for o in self._cfg.read(L(extra_files)+[self.config_file], encoding='utf8')]\n",
22682268
" if self.config_file not in found and create is not None:\n",
22692269
" self._cfg.read_dict({'DEFAULT':create})\n",
22702270
" if save:\n",

0 commit comments

Comments
 (0)