You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Ali-Akber Saifee (Jira)" <ji...@apache.org> on 2021/12/12 00:31:00 UTC

[jira] [Created] (THRIFT-5488) SystemError when using fast binary protocol in python 3.10

Ali-Akber Saifee created THRIFT-5488:
----------------------------------------

             Summary: SystemError when using fast binary protocol in python 3.10 
                 Key: THRIFT-5488
                 URL: https://issues.apache.org/jira/browse/THRIFT-5488
             Project: Thrift
          Issue Type: Bug
          Components: Python - Library
    Affects Versions: 0.15.0
            Reporter: Ali-Akber Saifee


Up till python 3.9  a DeprecationWarning was raised when '#' formats were used without defining PY_SSIZE_T_CLEAN:

 
{code:java}
DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
  iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) {code}
 

Starting with python 3.10 this now becomes a runtime SystemError. Details of change: [Python bug tracker 40943|https://bugs.python.org/issue40943]

This specifically gets exercised in the fast binary python extension module in ProtocolBase<Impl>::readBytes ([src/protocol.tcc|https://github.com/apache/thrift/blob/master/lib/py/src/ext/protocol.tcc#L279]) when falling back to the building function.

An easy way to reproduce the error is to pass an empty byte array to the [TSerializer.deserialize|https://github.com/apache/thrift/blob/master/lib/py/src/TSerialization.py#L32] method



--
This message was sent by Atlassian Jira
(v8.20.1#820001)