From ffe3ba140e256eb85ac7fbb4c646ecf419d81e9a Mon Sep 17 00:00:00 2001 From: Alfredo Altamirano <8353891+Ahuahuachi@users.noreply.github.com> Date: Tue, 13 Dec 2022 00:29:58 -0600 Subject: [PATCH] fix: TypeError when using frappe.throw() or frappe.msgprint() with lists (#19255) Co-authored-by: Alfredo Altamirano [skip ci] --- frappe/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frappe/__init__.py b/frappe/__init__.py index 9f4207a750..1d2d4a6a1b 100644 --- a/frappe/__init__.py +++ b/frappe/__init__.py @@ -453,7 +453,10 @@ def msgprint( out.as_list = 1 if sys.stdin and sys.stdin.isatty(): - msg = _strip_html_tags(out.message) + if out.as_list: + msg = [_strip_html_tags(msg) for msg in out.message] + else: + msg = _strip_html_tags(out.message) if flags.print_messages and out.message: print(f"Message: {_strip_html_tags(out.message)}")