控制台脚本报错
zuozh11 opened this issue · 2 comments
zuozh11 commented
平台:x64
系统:Windows 11 专业版 22H2 22621.2861
问题:双击 embyToLocalPlayer_debug.bat 无报错,按按1(窗口运行)时出现异常,异常信息如下
Pythone 版本:Python 3.10.11
C:\Program Files\Python310\python.exe
press a number
1: run in console
2: run in background and add to startup folder
3: open startup folder
4: path translate helper
5: copy script path to clipboard
6: update to latest version
press a number 1
you have pressed one
[01/09/24 17:11:43] ['Python path: C:\\Program Files\\Python310\\python.exe']
[01/09/24 17:11:43] ['ini path: C:\\Users\\_hide_user_\\embyToLocalPlayer\\embyToLocalPlayer_config.ini']
[01/09/24 17:11:43] Windows-10-10.0.22621-SP0 Python-3.10.11
Traceback (most recent call last):
File "C:\Users\_hide_user_\embyToLocalPlayer\embyToLocalPlayer.py", line 144, in <module>
kill_multi_process(name_re=f'(embyToLocalPlayer.py|autohotkey_tool|' +
File "C:\Users\_hide_user_\embyToLocalPlayer\utils\tools.py", line 103, in kill_multi_process
pid_cmd = list_pid_and_cmd(name_re)
File "C:\Users\_hide_user_\embyToLocalPlayer\utils\windows_tool.py", line 26, in list_pid_and_cmd
result = [(i['ProcessId'], i['CommandLine']) for i in json.loads(proc.stdout)
File "C:\Program Files\Python310\lib\json\__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Program Files\Python310\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Program Files\Python310\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
all tasks are finished.
Press any key to continue . . .```
kjtsune commented
无法复现,不好处理,.bat 按6更新。
新版会跳过错误,但重启脚本时候不会杀死多余后台,有时候需要任务管理器手动杀死进程。
zuozh11 commented
更新后成功运行了