From 6e84da767182df558df98fec65f7140b812a214b Mon Sep 17 00:00:00 2001 From: Tin Lam Date: Tue, 7 Apr 2020 16:29:47 -0500 Subject: [PATCH] fix(mariadb): encode Popen() returns subprocess.Popen() returns byte object by defect which has issue with operations that treats thing as str. This ensure Popen() encodes the return as utf-8 before we do anything. Change-Id: I321771f69cfcb492be1308c61313a0598b1e766a Signed-off-by: Tin Lam --- mariadb/templates/bin/_start.py.tpl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mariadb/templates/bin/_start.py.tpl b/mariadb/templates/bin/_start.py.tpl index 22309cb72..2b7088138 100644 --- a/mariadb/templates/bin/_start.py.tpl +++ b/mariadb/templates/bin/_start.py.tpl @@ -547,7 +547,8 @@ def update_grastate_on_restart(): '--wsrep_cluster_address=gcomm://', '--wsrep-recover' ], stdout=subprocess.PIPE, - stderr=subprocess.PIPE) + stderr=subprocess.PIPE, + encoding="utf-8") out, err = wsrep_recover.communicate() wsrep_rec_pos = '-1' for item in err.split("\n"):