Neil Williams created THRIFT-5352: ------------------------------------- Summary: Python: IDL exceptions with no fields can't be instantiated Key: THRIFT-5352 URL: https://issues.apache.org/jira/browse/THRIFT-5352 Project: Thrift Issue Type: Bug Components: Python - Library Reporter: Neil Williams
{{$ thrift --version}} {{Thrift version 0.14.0}} {{}}{{$ pip freeze | grep thrift}} {{thrift==0.14.0}} {{$ cat test.thrift}} {{exception LookMaNoFields {}}} {{$ thrift -out . -gen py test.thrift}}{{$ python}} {{>>> from test.ttypes import LookMaNoFields}} {{>>> LookMaNoFields()}} {{Traceback (most recent call last):}} {{ File "<stdin>", line 1, in <module>}} {{ File "/src/thrift/lib/py/thrift/Thrift.py", line 93, in __init__}} {{ super(TException, self).__setattr__("message", message)}} {{ File "/src/example/test/ttypes.py", line 23, in __setattr__}} {{ raise TypeError("can't modify immutable instance")}} {{TypeError: can't modify immutable instance}} This appears to be related to the changes in THRIFT-4002. In the case where there are no fields, no special constructor gets created and we fall back to TException's base constructor which tries to set the message attribute on the instance. -- This message was sent by Atlassian Jira (v8.3.4#803005)