mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-09-28 16:20:56 +08:00
Enhance subprocess calls with encoding and error handling (#2154)
Added encoding and error handling parameters to subprocess calls.
This commit is contained in:
@@ -46,6 +46,8 @@ class VirtualEnvPackageManager:
|
|||||||
check=True,
|
check=True,
|
||||||
capture_output=True,
|
capture_output=True,
|
||||||
text=True,
|
text=True,
|
||||||
|
encoding="utf-8",
|
||||||
|
errors="replace",
|
||||||
)
|
)
|
||||||
logger.debug(
|
logger.debug(
|
||||||
f"安装虚拟环境包指令执行完成: {result.stdout}",
|
f"安装虚拟环境包指令执行完成: {result.stdout}",
|
||||||
@@ -77,6 +79,8 @@ class VirtualEnvPackageManager:
|
|||||||
check=True,
|
check=True,
|
||||||
capture_output=True,
|
capture_output=True,
|
||||||
text=True,
|
text=True,
|
||||||
|
encoding="utf-8",
|
||||||
|
errors="replace",
|
||||||
)
|
)
|
||||||
logger.debug(
|
logger.debug(
|
||||||
f"卸载虚拟环境包指令执行完成: {result.stdout}",
|
f"卸载虚拟环境包指令执行完成: {result.stdout}",
|
||||||
@@ -109,6 +113,8 @@ class VirtualEnvPackageManager:
|
|||||||
check=True,
|
check=True,
|
||||||
capture_output=True,
|
capture_output=True,
|
||||||
text=True,
|
text=True,
|
||||||
|
encoding="utf-8",
|
||||||
|
errors="replace",
|
||||||
)
|
)
|
||||||
logger.debug(f"更新虚拟环境包指令执行完成: {result.stdout}", LOG_COMMAND)
|
logger.debug(f"更新虚拟环境包指令执行完成: {result.stdout}", LOG_COMMAND)
|
||||||
return result.stdout
|
return result.stdout
|
||||||
@@ -177,6 +183,8 @@ class VirtualEnvPackageManager:
|
|||||||
check=True,
|
check=True,
|
||||||
capture_output=True,
|
capture_output=True,
|
||||||
text=True,
|
text=True,
|
||||||
|
encoding="utf-8",
|
||||||
|
errors="replace",
|
||||||
)
|
)
|
||||||
logger.debug(
|
logger.debug(
|
||||||
f"安装虚拟环境依赖文件指令执行完成: {result.stdout}",
|
f"安装虚拟环境依赖文件指令执行完成: {result.stdout}",
|
||||||
@@ -209,6 +217,8 @@ class VirtualEnvPackageManager:
|
|||||||
check=True,
|
check=True,
|
||||||
capture_output=True,
|
capture_output=True,
|
||||||
text=True,
|
text=True,
|
||||||
|
encoding="utf-8",
|
||||||
|
errors="replace",
|
||||||
)
|
)
|
||||||
logger.debug(
|
logger.debug(
|
||||||
f"列出虚拟环境包指令执行完成: {result.stdout}",
|
f"列出虚拟环境包指令执行完成: {result.stdout}",
|
||||||
|
|||||||
Reference in New Issue
Block a user