最在在使用pytest,用的是pytest 3.9.3,python版本为2.7.10,但一直在使用时发现总提示

File "c:\python27\Lib\json\__init__.py", line 189, in dump
    for chunk in iterable:
  File "c:\python27\Lib\json\encoder.py", line 431, in _iterencode
    for chunk in _iterencode_list(o, _current_indent_level):
  File "c:\python27\Lib\json\encoder.py", line 313, in _iterencode_list
    yield buf + _encoder(value)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xb7 in position 2: invalid start byte

 

在反复查看后,原来我的项目路径中存在中文字符,有两种解决方法

1、将pytest降版本,降至3.1.2

2、将项目路径改成全英文

 

随后将该问题提示github并确认为bug

 https://github.com/pytest-dev/pytest/issues/4290

相关文章:

  • 2022-12-23
  • 2021-05-25
  • 2021-12-03
  • 2021-07-31
  • 2022-02-13
  • 2022-02-19
  • 2021-11-18
  • 2021-07-20
猜你喜欢
  • 2021-07-21
  • 2021-11-17
  • 2022-12-23
  • 2022-12-23
  • 2021-10-15
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案