From 247f2be7fe3108038276615cb9493b82fced0001 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Dudr?= Date: Fri, 4 Nov 2022 12:49:37 +0100 Subject: [PATCH] fix exception on binary data --- python3/vdebug/dbgp.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python3/vdebug/dbgp.py b/python3/vdebug/dbgp.py index 053f018..4438a1d 100644 --- a/python3/vdebug/dbgp.py +++ b/python3/vdebug/dbgp.py @@ -458,8 +458,11 @@ def _get_enc_node_text(self, node, name, default=None): n = node.find('%s%s' % (self.ns, name)) if n is not None and n.text is not None: if n.get('encoding') == 'base64': - val = base64.decodebytes(n.text.encode("UTF-8")).decode( - "UTF-8") + try: + val = base64.decodebytes(n.text.encode("UTF-8")).decode( + "UTF-8") + except UnicodeDecodeError: + val = n.text else: val = n.text else: