[ https://issues.apache.org/jira/browse/THRIFT-4207?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16223555#comment-16223555 ]
ASF GitHub Bot commented on THRIFT-4207: ---------------------------------------- Github user nsuke commented on a diff in the pull request: https://github.com/apache/thrift/pull/1274#discussion_r147555909 --- Diff: lib/py/src/protocol/TProtocol.py --- @@ -118,6 +118,8 @@ def writeDouble(self, dub): pass def writeString(self, str_val): + if isinstance(str_val, bytes): + str_val = str_val.decode('utf8') --- End diff -- This would break py2 > Accelerated version of TBinaryProtocol allows invalid input to string fields. > ----------------------------------------------------------------------------- > > Key: THRIFT-4207 > URL: https://issues.apache.org/jira/browse/THRIFT-4207 > Project: Thrift > Issue Type: Bug > Components: Python - Library > Affects Versions: 0.10.0 > Reporter: Elvis Pranskevichus > Assignee: James E. King, III > Fix For: 0.11.0 > > > {{TBinaryProtocolAccelerated}} and {{TCompactProtocolAccelerated}} currently > accept arbitrary bytes as input to string fields even when {{py:utf8strings}} > is on. -- This message was sent by Atlassian JIRA (v6.4.14#64029)