You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by je...@apache.org on 2020/11/01 17:24:44 UTC

[thrift] branch master updated: THRIFT-5303 Fix missing error handling in using PyUnicode_DecodeUTF8 Client: py Patch: stiga-huang

This is an automated email from the ASF dual-hosted git repository.

jensg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/thrift.git


The following commit(s) were added to refs/heads/master by this push:
     new 05bb551  THRIFT-5303 Fix missing error handling in using PyUnicode_DecodeUTF8 Client: py Patch: stiga-huang
05bb551 is described below

commit 05bb55148608b4324a8c91c21cf9a6a0dff282fa
Author: stiga-huang <hu...@gmail.com>
AuthorDate: Fri Oct 30 20:07:31 2020 +0800

    THRIFT-5303 Fix missing error handling in using PyUnicode_DecodeUTF8
    Client: py
    Patch: stiga-huang
    
    This closes #2269
---
 lib/py/src/ext/protocol.tcc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 @@ PyObject* ProtocolBase<Impl>::decodeValue(TType type, PyObject* typeargs) {
       return nullptr;
     }
     if (isUtf8(typeargs)) {
-      return PyUnicode_DecodeUTF8(buf, len, 0);
+      return PyUnicode_DecodeUTF8(buf, len, "replace");
     } else {
       return PyBytes_FromStringAndSize(buf, len);
     }