Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnicodeDecodeError: 'gbk' codec can't decode byte 0xa1 in position 23: illegal multibyte sequence #17

Open
lindychan opened this issue Jun 18, 2022 · 2 comments

Comments

@lindychan
Copy link

image

安装之后,执行run.py 报错
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa1 in position 23: illegal multibyte sequence

`run.py
2022-06-18 13:17:53.411 | INFO | main::29 -
══════════════════════════════════════════
║ WEB-UI-AUTO ║
║ No one can put out the stars ! ║
══════════════════════════════════════════

2022-06-18 13:17:53.423 | INFO | public.common:run_del_report:218 - 清除测试报告中.....
Traceback (most recent call last):
File "D:\lin_space\test\hanwenlu2016web-ui\run.py", line 225, in
RunPytest.run_bebug()
File "D:\lin_space\test\hanwenlu2016web-ui\run.py", line 209, in run_bebug
pytest.main(
File "D:\conda1\envs\uiautotest\lib\site-packages_pytest\config_init_.py", line 145, in main
config = prepareconfig(args, plugins)
File "D:\conda1\envs\uiautotest\lib\site-packages_pytest\config_init
.py", line 324, in _prepareconfig
config = pluginmanager.hook.pytest_cmdline_parse(
File "D:\conda1\envs\uiautotest\lib\site-packages\pluggy_hooks.py", line 265, in call
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
File "D:\conda1\envs\uiautotest\lib\site-packages\pluggy_manager.py", line 80, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "D:\conda1\envs\uiautotest\lib\site-packages\pluggy_callers.py", line 55, in multicall
gen.send(outcome)
File "D:\conda1\envs\uiautotest\lib\site-packages_pytest\helpconfig.py", line 102, in pytest_cmdline_parse
config: Config = outcome.get_result()
File "D:\conda1\envs\uiautotest\lib\site-packages\pluggy_result.py", line 60, in get_result
raise ex[1].with_traceback(ex[2])
File "D:\conda1\envs\uiautotest\lib\site-packages\pluggy_callers.py", line 39, in multicall
res = hook_impl.function(*args)
File "D:\conda1\envs\uiautotest\lib\site-packages_pytest\config_init
.py", line 1016, in pytest_cmdline_parse
self.parse(args)
File "D:\conda1\envs\uiautotest\lib\site-packages_pytest\config_init
.py", line 1304, in parse
self.preparse(args, addopts=addopts)
File "D:\conda1\envs\uiautotest\lib\site-packages_pytest\config_init
.py", line 1172, in _preparse
self.initini(args)
File "D:\conda1\envs\uiautotest\lib\site-packages_pytest\config_init
.py", line 1091, in _initini
rootpath, inipath, inicfg = determine_setup(
File "D:\conda1\envs\uiautotest\lib\site-packages_pytest\config\findpaths.py", line 186, in determine_setup
rootdir, inipath, inicfg = locate_config([ancestor])
File "D:\conda1\envs\uiautotest\lib\site-packages_pytest\config\findpaths.py", line 108, in locate_config
ini_config = load_config_dict_from_file(p)
File "D:\conda1\envs\uiautotest\lib\site-packages_pytest\config\findpaths.py", line 45, in load_config_dict_from_file
iniconfig = _parse_ini_config(filepath)
File "D:\conda1\envs\uiautotest\lib\site-packages_pytest\config\findpaths.py", line 30, in parse_ini_config
return iniconfig.IniConfig(str(path))
File "D:\conda1\envs\uiautotest\lib\site-packages\iniconfig_init
.py", line 54, in init
tokens = self.parse(iter(f))
File "D:\conda1\envs\uiautotest\lib\site-packages\iniconfig_init
.py", line 82, in _parse
for lineno, line in enumerate(line_iter):
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa1 in position 23: illegal multibyte sequence

Process finished with exit code 1
`

@hanwenlu2016
Copy link
Owner

图片

安装之后,执行run.py报错 UnicodeDecodeError: 'gbk' codec can't decode byte 0xa1 in position 23: invalid multibyte sequence

`run.py 2022-06-18 13:17:53.411 | 信息 | 主要::29 - ════════════════════════════════════════WEB- UI-AUTO ║ ║ 没有人能熄灭星星!║══════════════════════════════════════════ _

2022-06-18 13:17:53.423 | INFO | public.common:run_del_report:218 - 清除测试报告中..... Traceback (most recent call last): File "D:\lin_space\test\hanwenlu2016web-ui\run.py", line 225, in RunPytest.run_bebug() File "D:\lin_space\test\hanwenlu2016web-ui\run.py", line 209, in run_bebug pytest.main( File "D:\conda1\envs\uiautotest\lib\site-packages_pytest\config__init__.py", line 145, in main config = prepareconfig(args, plugins) File "D:\conda1\envs\uiautotest\lib\site-packages_pytest\config__init_.py", line 324, in _prepareconfig config = pluginmanager.hook.pytest_cmdline_parse( File "D:\conda1\envs\uiautotest\lib\site-packages\pluggy_hooks.py", line 265, in call return self.hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) File "D:\conda1\envs\uiautotest\lib\site-packages\pluggy_manager.py", line 80, in hookexec return self.inner_hookexec(hook_name, methods, kwargs, firstresult) File "D:\conda1\envs\uiautotest\lib\site-packages\pluggy_callers.py", line 55, in multicall gen.send(outcome) File "D:\conda1\envs\uiautotest\lib\site-packages_pytest\helpconfig.py", line 102, in pytest_cmdline_parse config: Config = outcome.get_result() File "D:\conda1\envs\uiautotest\lib\site-packages\pluggy_result.py", line 60, in get_result raise ex[1].with_traceback(ex[2]) File "D:\conda1\envs\uiautotest\lib\site-packages\pluggy_callers.py", line 39, in multicall res = hook_impl.function(*args) File "D:\conda1\envs\uiautotest\lib\site-packages_pytest\config__init.py", line 1016, in pytest_cmdline_parse self.parse(args) File "D:\conda1\envs\uiautotest\lib\site-packages_pytest\config__init.py", line 1304, in parse self.preparse(args, addopts=addopts) File "D:\conda1\envs\uiautotest\lib\site-packages_pytest\config__init.py", line 1172, in preparse self.initini(args) File "D:\conda1\envs\uiautotest\lib\site-packages_pytest\config__init.py", line 1091, in initini rootpath, inipath, inicfg = determine_setup( File "D:\conda1\envs\uiautotest\lib\site-packages_pytest\config\findpaths.py", line 186, in determine_setup rootdir, inipath, inicfg = locate_config([ancestor]) File "D:\conda1\envs\uiautotest\lib\site-packages_pytest\config\findpaths.py", line 108, in locate_config ini_config = load_config_dict_from_file(p) File "D:\conda1\envs\uiautotest\lib\site-packages_pytest\config\findpaths.py", line 45, in load_config_dict_from_file iniconfig = parse_ini_config(filepath) File "D:\conda1\envs\uiautotest\lib\site-packages_pytest\config\findpaths.py", line 30, in parse_ini_config return iniconfig.IniConfig(str(path)) File "D:\conda1\envs\uiautotest\lib\site-packages\iniconfig__init.py", line 54, in init tokens = self.parse(iter(f)) File "D:\conda1\envs\uiautotest\lib\site-packages\iniconfig__init.py", line 82, in _parse for lineno, line in enumerate(line_iter): UnicodeDecodeError: 'gbk' codec can't decode byte 0xa1 in position 23: illegal multibyte sequence

Process finished with exit code 1 `

检查下pytest.ini 文件是不是utf-8

@daibiao666
Copy link

image

安装之后,执行run.py 报错 UnicodeDecodeError: 'gbk' codec can't decode byte 0xa1 in position 23: illegal multibyte sequence

`run.py 2022-06-18 13:17:53.411 | INFO | main::29 - ══════════════════════════════════════════ ║ WEB-UI-AUTO ║ ║ No one can put out the stars ! ║ ══════════════════════════════════════════

2022-06-18 13:17:53.423 | INFO | public.common:run_del_report:218 - 清除测试报告中..... Traceback (most recent call last): File "D:\lin_space\test\hanwenlu2016web-ui\run.py", line 225, in RunPytest.run_bebug() File "D:\lin_space\test\hanwenlu2016web-ui\run.py", line 209, in run_bebug pytest.main( File "D:\conda1\envs\uiautotest\lib\site-packages_pytest\config__init__.py", line 145, in main config = prepareconfig(args, plugins) File "D:\conda1\envs\uiautotest\lib\site-packages_pytest\config__init_.py", line 324, in _prepareconfig config = pluginmanager.hook.pytest_cmdline_parse( File "D:\conda1\envs\uiautotest\lib\site-packages\pluggy_hooks.py", line 265, in call return self.hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) File "D:\conda1\envs\uiautotest\lib\site-packages\pluggy_manager.py", line 80, in hookexec return self.inner_hookexec(hook_name, methods, kwargs, firstresult) File "D:\conda1\envs\uiautotest\lib\site-packages\pluggy_callers.py", line 55, in multicall gen.send(outcome) File "D:\conda1\envs\uiautotest\lib\site-packages_pytest\helpconfig.py", line 102, in pytest_cmdline_parse config: Config = outcome.get_result() File "D:\conda1\envs\uiautotest\lib\site-packages\pluggy_result.py", line 60, in get_result raise ex[1].with_traceback(ex[2]) File "D:\conda1\envs\uiautotest\lib\site-packages\pluggy_callers.py", line 39, in multicall res = hook_impl.function(*args) File "D:\conda1\envs\uiautotest\lib\site-packages_pytest\config__init.py", line 1016, in pytest_cmdline_parse self.parse(args) File "D:\conda1\envs\uiautotest\lib\site-packages_pytest\config__init.py", line 1304, in parse self.preparse(args, addopts=addopts) File "D:\conda1\envs\uiautotest\lib\site-packages_pytest\config__init.py", line 1172, in preparse self.initini(args) File "D:\conda1\envs\uiautotest\lib\site-packages_pytest\config__init.py", line 1091, in initini rootpath, inipath, inicfg = determine_setup( File "D:\conda1\envs\uiautotest\lib\site-packages_pytest\config\findpaths.py", line 186, in determine_setup rootdir, inipath, inicfg = locate_config([ancestor]) File "D:\conda1\envs\uiautotest\lib\site-packages_pytest\config\findpaths.py", line 108, in locate_config ini_config = load_config_dict_from_file(p) File "D:\conda1\envs\uiautotest\lib\site-packages_pytest\config\findpaths.py", line 45, in load_config_dict_from_file iniconfig = parse_ini_config(filepath) File "D:\conda1\envs\uiautotest\lib\site-packages_pytest\config\findpaths.py", line 30, in parse_ini_config return iniconfig.IniConfig(str(path)) File "D:\conda1\envs\uiautotest\lib\site-packages\iniconfig__init.py", line 54, in init tokens = self.parse(iter(f)) File "D:\conda1\envs\uiautotest\lib\site-packages\iniconfig__init.py", line 82, in _parse for lineno, line in enumerate(line_iter): UnicodeDecodeError: 'gbk' codec can't decode byte 0xa1 in position 23: illegal multibyte sequence

Process finished with exit code 1 `

删除pytest.ini 里面的中文注释

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants