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..2b1578cd67 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 @@ -175,14 +175,20 @@ def _send_mail(self, subject, state_list): if 'DESCRIPTION' in x: description = EmailBody() description.type = 'text' - description.message = x['DESCRIPTION'] + description_txt = x['DESCRIPTION'] + if isinstance(description_txt, bytes): + description_txt = description_txt.decode('utf-8') + description.message = description_txt email_msg.body.append(description) email_msg.body.append(changeline) if 'IMAGE' in x and x['IMAGE']: 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) @@ -193,7 +199,10 @@ def _send_mail(self, subject, state_list): if 'INFO' in x: info = EmailBody() info.type = 'text' - info.message = x['INFO'] + info_txt = x['INFO'] + if isinstance(info_txt, bytes): + info_txt = info_txt.decode('utf-8') + info.message = info_txt email_msg.body.append(info) email_msg.body.append(changeline) # rospy.loginfo("body:{}".format(email_msg.body))