replace "utf8" alias by canonical "utf-8" locale code + remove the second Python2 vs Py3 compat.py
Client: py
Patch: Alexandre Detiste
This closes #3105
diff --git a/lib/py/src/protocol/TBinaryProtocol.py b/lib/py/src/protocol/TBinaryProtocol.py
index e59e0dc..af64ec1 100644
--- a/lib/py/src/protocol/TBinaryProtocol.py
+++ b/lib/py/src/protocol/TBinaryProtocol.py
@@ -17,10 +17,10 @@
# under the License.
#
-from .TProtocol import TType, TProtocolBase, TProtocolException, TProtocolFactory
-from ..compat import binary_to_str
from struct import pack, unpack
+from .TProtocol import TType, TProtocolBase, TProtocolException, TProtocolFactory
+
class TBinaryProtocol(TProtocolBase):
"""Binary implementation of the Thrift protocol driver."""
@@ -146,7 +146,7 @@
if self.strictRead:
raise TProtocolException(type=TProtocolException.BAD_VERSION,
message='No protocol version header')
- name = binary_to_str(self.trans.readAll(sz))
+ name = self.trans.readAll(sz).decode('utf-8')
type = self.readByte()
seqid = self.readI32()
return (name, type, seqid)