From 4856044cc9286ec10f90a4c9ce4c8c986e2dc7a2 Mon Sep 17 00:00:00 2001 From: Shingo Kitagawa Date: Mon, 27 Mar 2023 01:04:52 +0900 Subject: [PATCH] fix python3 decode error in smach_to_mail --- jsk_robot_common/jsk_robot_startup/scripts/smach_to_mail.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jsk_robot_common/jsk_robot_startup/scripts/smach_to_mail.py b/jsk_robot_common/jsk_robot_startup/scripts/smach_to_mail.py index dee5af4b08..e892a383a1 100755 --- a/jsk_robot_common/jsk_robot_startup/scripts/smach_to_mail.py +++ b/jsk_robot_common/jsk_robot_startup/scripts/smach_to_mail.py @@ -182,7 +182,10 @@ def _send_mail(self, subject, state_list): image = EmailBody() image.type = 'img' image.img_size = 100 - image.img_data = x['IMAGE'] + img_txt = x['IMAGE'] + if isinstance(img_txt, bytes): + img_txt = img_txt.decode('utf-8') + image.img_data = img_txt email_msg.body.append(image) email_msg.body.append(changeline) email_msg.body.append(changeline)