UnicodeDecodeError occurs when reading settings.ini
file containing CJK characters on Windows, due to missing encoding parameter
#483
Labels
bug
Something isn't working
When I tried to preview/test/prepare an nbdev project with
settings.ini
(UTF-8 encorded) which containing some CKJ (or maybe other non-ascii) characters, an error such asUnicodeDecodeError: 'cp932' codec can't decode byte 0x82 in position 725: illegal multibyte sequence
ocurred.Example of settings and full error message
When a setting file containing a line like
and nbdev_* command executed, output is like below:
Version info:
Operating system: Windows 11 Pro (Japanese)
Python 3.10.6
nbdev 2.1.7
This error is likely caused due to no encoding being specified here:
https://github.com/fastai/fastcore/blob/894bf94a3fcab91c85f05bc9a974a747533e9040/fastcore/foundation.py#L258
The error seems to be resolved by adding
encoding='utf-8'
to the argument of the ConfigParser.read() method.The text was updated successfully, but these errors were encountered: