vijos/jd4

Failed when config.yaml contains Chinese characters

Closed this issue · 0 comments

twd2 commented
Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/venv/lib/python3.5/site-packages/jd4/daemon.py", line 5, in <module>
    from jd4.api import VJ4Session
  File "/venv/lib/python3.5/site-packages/jd4/api.py", line 7, in <module>
    from jd4.config import cookie_jar, save_cookies
  File "/venv/lib/python3.5/site-packages/jd4/config.py", line 22, in <module>
    config = _load_config()
  File "/venv/lib/python3.5/site-packages/jd4/config.py", line 17, in _load_config
    return yaml.load(file, Loader=yaml.RoundTripLoader)
  File "/venv/lib/python3.5/site-packages/ruamel/yaml/main.py", line 634, in load
    loader = Loader(stream, version, preserve_quotes=preserve_quotes)
  File "/venv/lib/python3.5/site-packages/ruamel/yaml/loader.py", line 59, in __init__
    Reader.__init__(self, stream, loader=self)
  File "/venv/lib/python3.5/site-packages/ruamel/yaml/reader.py", line 80, in __init__
    self.stream = stream  # type: Any  # as .read is called
  File "/venv/lib/python3.5/site-packages/ruamel/yaml/reader.py", line 125, in stream
    self.determine_encoding()
  File "/venv/lib/python3.5/site-packages/ruamel/yaml/reader.py", line 169, in determine_encoding
    self.update_raw()
  File "/venv/lib/python3.5/site-packages/ruamel/yaml/reader.py", line 253, in update_raw
    data = self.stream.read(size)
  File "/usr/lib/python3.5/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 38: ordinal not in range(128)