commit | 05bb55148608b4324a8c91c21cf9a6a0dff282fa | [log] [tgz] |
---|---|---|
author | stiga-huang <huangquanlong@gmail.com> | Fri Oct 30 20:07:31 2020 +0800 |
committer | Jens Geyer <jensg@apache.org> | Sun Nov 01 18:17:18 2020 +0100 |
tree | 187c6dcc7e81638746d9e15850ce441adaf290b7 | |
parent | 196254ba393a7e70e91fcf3c35026c82fb64f7fa [diff] |
THRIFT-5303 Fix missing error handling in using PyUnicode_DecodeUTF8 Client: py Patch: stiga-huang This closes #2269
diff --git a/lib/py/src/ext/protocol.tcc b/lib/py/src/ext/protocol.tcc index 03cfc9b..aad5a3c 100644 --- a/lib/py/src/ext/protocol.tcc +++ b/lib/py/src/ext/protocol.tcc
@@ -705,7 +705,7 @@ return nullptr; } if (isUtf8(typeargs)) { - return PyUnicode_DecodeUTF8(buf, len, 0); + return PyUnicode_DecodeUTF8(buf, len, "replace"); } else { return PyBytes_FromStringAndSize(buf, len); }