yoshichan5 / tcc

MIT License
2 stars 1 forks source link

Bug: Loading of yaml fails #4

Closed hitenkoku closed 1 year ago

hitenkoku commented 1 year ago

Describe the bug

Loading of yaml fails in environments where the standard character encoding is not UTF8.

Step to Reproduce Steps to reproduce the behavior:

  1. git clone https://github.com/yoshichan5/tcc
  2. poetry install
  3. following command execute
    >poetry run python .\tc-converter.py -f yaml -t xlsx  -o output.xlsx .\sample\sample.yaml
  4. Checked following error
Traceback (most recent call last):
  File "<TCCPath>\tcc\tc-converter.py", line 193, in <module>
    main()
  File "<Path>pypoetry\Cache\virtualenvs\tcc-WQrG47JU-py3.11\Lib\site-packages\click\core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<Path>pypoetry\Cache\virtualenvs\tcc-WQrG47JU-py3.11\Lib\site-packages\click\core.py", line 1055, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
...
  File "<Path>pypoetry\Cache\virtualenvs\tcc-WQrG47JU-py3.11\Lib\site-packages\yaml\reader.py", line 178, in update_raw
    data = self.stream.read(size)
           ^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'cp932' codec can't decode byte 0x86 in position 33: illegal multibyte sequence```

Expected behavior

Yaml is loaded without error.

Screenshots

happed following error.

Environment (please complete the following information):