我有几个使用 pywinauto 运行的 python 脚本。一切都很顺利,直到今天早上我现在都遇到了同样的错误。这是一个 pywinauto 错误还是我在某个地方犯了错误。
23:54:14 File "C:\jenkins_workspace\workspace\regression neo sl110\utilities\regression\Regression.py", line 141, in <module>
23:54:14 run_pgm(args.program, abspath_cfg, abspath_pgm, abspath_output, args.test)
23:54:14 File "C:\jenkins_workspace\workspace\regression neo sl110\utilities\regression\Regression.py", line 98, in run_pgm
23:54:14 result = Auto_Regression.pgm_manage(app, output)
23:54:14 File "C:\jenkins_workspace\workspace\regression neo sl110\utilities\regression\Auto_Regression.py", line 145, in pgm_manage
23:54:14 app.AquisitionError.OK.Click()
23:54:14 File "C:\Python27\lib\site-packages\pywinauto\application.py", line 229, in __getattr__
23:54:14 ctrls = _resolve_control(self.criteria)
23:54:14 File "C:\Python27\lib\site-packages\pywinauto\application.py", line 792, in _resolve_control
23:54:14 criteria)
23:54:14 File "C:\Python27\lib\site-packages\pywinauto\timings.py", line 339, in WaitUntilPasses
23:54:14 func_val = func(*args)
23:54:14 File "C:\Python27\lib\site-packages\pywinauto\application.py", line 558, in _get_ctrl
23:54:14 findwindows.find_window(**criteria[0]))
23:54:14 File "C:\Python27\lib\site-packages\pywinauto\findwindows.py", line 60, in find_window
23:54:14 windows = find_windows(**kwargs)
23:54:14 File "C:\Python27\lib\site-packages\pywinauto\findwindows.py", line 204, in find_windows
23:54:14 best_match, wrapped_wins)
23:54:14 File "C:\Python27\lib\site-packages\pywinauto\findbestmatch.py", line 457, in find_best_control_matches
23:54:14 name_control_map = build_unique_dict(controls)
23:54:14 File "C:\Python27\lib\site-packages\pywinauto\findbestmatch.py", line 435, in build_unique_dict
23:54:14 ctrl_names = get_control_names(ctrl, controls)
23:54:14 File "C:\Python27\lib\site-packages\pywinauto\findbestmatch.py", line 292, in get_control_names
23:54:14 non_text_names = GetNonTextControlName(control, allcontrols)
23:54:14 File "C:\Python27\lib\site-packages\pywinauto\findbestmatch.py", line 207, in GetNonTextControlName
23:54:14 if ctrl_.IsVisible() and ctrl_.WindowText() and ctrl_.can_be_label]
23:54:14 File "C:\Python27\lib\site-packages\pywinauto\controls\HwndWrapper.py", line 262, in WindowText
23:54:14 return handleprops.text(self)
23:54:14 File "C:\Python27\lib\site-packages\pywinauto\handleprops.py", line 58, in text
23:54:14 buffer_ = ctypes.create_unicode_buffer(length)
23:54:14 File "C:\Python27\lib\ctypes\__init__.py", line 310, in create_unicode_buffer
23:54:14 buftype = c_wchar * init
23:54:14 ValueError: Array length must be >= 0, not -1067052991