From 76247453a2d0bb3b70cd96d43f3b065bc205ee5e Mon Sep 17 00:00:00 2001 From: "yamamoto.taizo" Date: Sun, 18 Feb 2024 10:48:24 +0900 Subject: [PATCH] feat: chainging codepage --- contents/winrm_session.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/contents/winrm_session.py b/contents/winrm_session.py index 95821ed..3ecb9b4 100644 --- a/contents/winrm_session.py +++ b/contents/winrm_session.py @@ -70,9 +70,14 @@ def run_cmd(self, command, args=(), out_stream=None, err_stream=None, retry=1, r shell_id = None + DEFAULT_CODEPAGE = 65001 + codepage = DEFAULT_CODEPAGE + if "RD_NODE_CODEPAGE" in os.environ: + codepage = os.getenv("RD_NODE_CODEPAGE") + while retryCount < retry: try: - shell_id = self.protocol.open_shell(codepage=65001, env_vars=envs) + shell_id = self.protocol.open_shell(codepage=codepage, env_vars=envs) break except ConnectionError as e: if retryCount < retry: