From 9ff54ae3506027f59542e2d2f8cdf8d23007b1c0 Mon Sep 17 00:00:00 2001 From: Siting Ren Date: Fri, 8 Jul 2022 17:01:52 +0800 Subject: [PATCH] Fix #457: handle decode error for error/notice message (#460) --- .../vertica/messages/backend_messages/notice_response.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vertica_python/vertica/messages/backend_messages/notice_response.py b/vertica_python/vertica/messages/backend_messages/notice_response.py index 5b9dd3e4..6d496736 100644 --- a/vertica_python/vertica/messages/backend_messages/notice_response.py +++ b/vertica_python/vertica/messages/backend_messages/notice_response.py @@ -100,7 +100,7 @@ def _unpack_data(data): unpacked = unpack_from('c{0}sx'.format(null_byte - 1 - pos), data, pos) key = unpacked[0] value = unpacked[1] - data_mapping[key] = value.decode('utf-8') + data_mapping[key] = value.decode('utf-8', 'replace') pos += (len(value) + 2)