Skip to content

Commit

Permalink
Fix missing encoding when logging from Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
lucashuy committed Aug 29, 2023
1 parent 28becaf commit 8507091
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions aws_lambda_builders/workflows/custom_make/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import io
import logging
import shutil
import sys
import threading

LOG = logging.getLogger(__name__)
Expand Down Expand Up @@ -92,9 +93,11 @@ def run(self, args, env=None, cwd=None):

# Log every stdout line by iterating
for line in p.stdout:
decoded_line = line.decode("utf-8").strip()
LOG.info(decoded_line)
sys.stderr.buffer.write(line)
sys.stderr.flush()

# Gather total stdout
decoded_line = line.decode("utf-8").strip()
stdout += decoded_line

# Wait for the process to exit and stderr thread to end.
Expand Down

0 comments on commit 8507091

Please sign in to comment.