diff --git a/tools/azure-sdk-tools/packaging_tools/swaggertosdk/autorest_tools.py b/tools/azure-sdk-tools/packaging_tools/swaggertosdk/autorest_tools.py index 950660e2b4c4..68b35f701e76 100644 --- a/tools/azure-sdk-tools/packaging_tools/swaggertosdk/autorest_tools.py +++ b/tools/azure-sdk-tools/packaging_tools/swaggertosdk/autorest_tools.py @@ -4,7 +4,6 @@ from pathlib import Path import shutil import subprocess -import io _LOGGER = logging.getLogger(__name__) @@ -129,9 +128,10 @@ def execute_simple_command(cmd_line, cwd=None, shell=False, env=None): universal_newlines=True, cwd=cwd, shell=shell, - env=env) + env=env, + encoding='utf-8') output_buffer = [] - for line in io.TextIOWrapper(process.stdout, encoding='utf-8'): + for line in process.stdout: output_buffer.append(line.rstrip()) _LOGGER.info(f"==[autorest]"+output_buffer[-1]) process.wait()