Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.14.0
-
None
Description
$ 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.
Attachments
Issue Links
- links to