From b47d95449d64e69cc449577302bc49ab95a9fc6d Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 24 Nov 2020 17:05:08 +0100 Subject: [PATCH] deploy.py: Fix when running with Python 3.6 Which happens to be the default version on macOS 10.14. Python 3.6 does not return a sensible default encoding if you don't fiddle with your environment (like explicitly setting LANG). Fall back to UTF-8. Change-Id: I12534e4745e9c29b40a02c4946d8079d395cc650 Reviewed-by: Orgad Shaneh --- scripts/common.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/common.py b/scripts/common.py index d530afdb720..7b7936a8add 100644 --- a/scripts/common.py +++ b/scripts/common.py @@ -30,6 +30,8 @@ import subprocess import sys encoding = locale.getdefaultlocale()[1] +if not encoding: + encoding = 'UTF-8' def is_windows_platform(): return sys.platform.startswith('win')