diff --git a/.gitignore b/.gitignore index c7f990167..b031dced1 100644 --- a/.gitignore +++ b/.gitignore @@ -187,6 +187,7 @@ typings/ # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 # User-specific stuff: +.vscode # Sensitive or high-churn files: diff --git a/aws_lambda_builders/workflows/dotnet_clipackage/dotnetcli.py b/aws_lambda_builders/workflows/dotnet_clipackage/dotnetcli.py index b1fe104f1..5986b3656 100644 --- a/aws_lambda_builders/workflows/dotnet_clipackage/dotnetcli.py +++ b/aws_lambda_builders/workflows/dotnet_clipackage/dotnetcli.py @@ -4,6 +4,7 @@ import sys import logging +import locale from .utils import OSUtils @@ -49,6 +50,10 @@ def run(self, args, cwd=None): LOG.debug("executing dotnet: %s", invoke_dotnet) + # DotNet output is in system locale dependent encoding + # https://docs.microsoft.com/en-us/dotnet/api/system.console.outputencoding?view=netcore-3.1#remarks + # "The default code page that the console uses is determined by the system locale." + encoding = locale.getpreferredencoding() p = self.os_utils.popen(invoke_dotnet, stdout=self.os_utils.pipe, stderr=self.os_utils.pipe, cwd=cwd) out, err = p.communicate() @@ -56,7 +61,7 @@ def run(self, args, cwd=None): # The package command contains lots of useful information on how the package was created and # information when the package command was not successful. For that reason the output is # always written to the output to help developers diagnose issues. - LOG.info(out.decode("utf8").strip()) + LOG.info(out.decode(encoding).strip()) if p.returncode != 0: - raise DotnetCLIExecutionError(message=err.decode("utf8").strip()) + raise DotnetCLIExecutionError(message=err.decode(encoding).strip()) diff --git a/tests/integration/workflows/custom_make/test_custom_make.py b/tests/integration/workflows/custom_make/test_custom_make.py index 8b4e59fdd..6eec92c9f 100644 --- a/tests/integration/workflows/custom_make/test_custom_make.py +++ b/tests/integration/workflows/custom_make/test_custom_make.py @@ -44,7 +44,7 @@ def test_must_build_python_project_through_makefile(self): "chardet", "urllib3", "idna", - "urllib3-1.25.9.dist-info", + "urllib3-1.25.10.dist-info", "chardet-3.0.4.dist-info", "certifi-2020.4.5.2.dist-info", "certifi",