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/__init__.py b/aws_lambda_builders/__init__.py index 92d3e3346..50f740c9d 100644 --- a/aws_lambda_builders/__init__.py +++ b/aws_lambda_builders/__init__.py @@ -1,5 +1,5 @@ """ AWS Lambda Builder Library """ -__version__ = "1.0.0" +__version__ = "1.1.0" RPC_PROTOCOL_VERSION = "0.3" 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/aws_lambda_builders/workflows/ruby_bundler/bundler.py b/aws_lambda_builders/workflows/ruby_bundler/bundler.py index 33405f233..fecee69a9 100644 --- a/aws_lambda_builders/workflows/ruby_bundler/bundler.py +++ b/aws_lambda_builders/workflows/ruby_bundler/bundler.py @@ -48,9 +48,10 @@ def run(self, args, cwd=None): p = self.osutils.popen(invoke_bundler, stdout=self.osutils.pipe, stderr=self.osutils.pipe, cwd=cwd) - out, err = p.communicate() + out, _ = p.communicate() if p.returncode != 0: - raise BundlerExecutionError(message=err.decode("utf8").strip()) + # Bundler has relevant information in stdout, not stderr. + raise BundlerExecutionError(message=out.decode("utf8").strip()) return out.decode("utf8").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", diff --git a/tests/unit/workflows/ruby_bundler/test_bundler.py b/tests/unit/workflows/ruby_bundler/test_bundler.py index 7a83af11a..fb8ab4612 100644 --- a/tests/unit/workflows/ruby_bundler/test_bundler.py +++ b/tests/unit/workflows/ruby_bundler/test_bundler.py @@ -58,7 +58,7 @@ def test_returns_popen_out_decoded_if_retcode_is_0(self): def test_raises_BundlerExecutionError_with_err_text_if_retcode_is_not_0(self): self.popen.returncode = 1 - self.popen.err = b"some error text\n\n" + self.popen.out = b"some error text\n\n" with self.assertRaises(BundlerExecutionError) as raised: self.under_test.run(["install", "--without", "development", "test"]) self.assertEqual(raised.exception.args[0], "Bundler Failed: some error text")