pytest-dev / iniconfig

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is class IniConfig support char code option?

kou65536 opened this issue · comments

I use tox the testing tool for python in Windows 10 enviroment.
The problem is that class IniConfig tries to read tox.ini with cp932 encoding.
I read the code https://github.com/pytest-dev/iniconfig/blob/master/src/iniconfig/__init__.py#L51 . This not seems to have argument of encoding. Is this possible to set encoding?

  • run command:
tox -c $Env:PROJECT_DIR/tox.ini -e py39
  • bottom of stack trace
  File "c:\work\reni\git\ogs\.venv\lib\site-packages\py\_vendored_packages\iniconfig\__init__.py", line 54, in __init__
    tokens = self._parse(iter(f))
  File "c:\work\reni\git\ogs\.venv\lib\site-packages\py\_vendored_packages\iniconfig\__init__.py", line 82, in _parse
    for lineno, line in enumerate(line_iter):
UnicodeDecodeError: 'cp932' codec can't decode byte 0x81 in position 115: illegal multibyte sequence