thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James E. King III (JIRA)" <>
Subject [jira] [Closed] (THRIFT-4089) Several issues with generated Python code: TFrozenDict, _fast_encode
Date Fri, 04 Jan 2019 03:10:02 GMT


James E. King III closed THRIFT-4089.

This issue was resolved without a fixVersion but was not closed - closing.

> Several issues with generated Python code: TFrozenDict, _fast_encode
> --------------------------------------------------------------------
>                 Key: THRIFT-4089
>                 URL:
>             Project: Thrift
>          Issue Type: Bug
>          Components: Python - Compiler
>    Affects Versions: 0.10.0
>         Environment: Python 2.7, 3.5. OS-X
>            Reporter: Manasi Vartak
>            Priority: Major
> When you generate Python sources for a simple thrift file (e.g. Thrift tutorial from will also repro erros), errors are thrown while running
the PythonServer and PythonClient.
> 1.  When running the vanilla PythonServer, I get the following error:
> File "gen-py/shared/", line 9, in <module>
>     from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException

> ImportError: cannot import name TFrozenDict
> I see this error consistently for all generated thrift files. The error disappears on
removing TFrozenDict from the generated files (it is not used anywhere in the file).
> 2. When running the vanilla PythonClient (the server is now running after the above fix),
I get the following error:
>  File "", line 51, in main
>   File "gen-py/tutorial/", line 73, in ping
>     self.send_ping()
>   File "gen-py/tutorial/", line 79, in send_ping
>     args.write(self._oprot)
>   File "gen-py/tutorial/", line 297, in write
>     if oprot._fast_encode is not None and self.thrift_spec is not None:
> AttributeError: TBinaryProtocol instance has no attribute '_fast_encode'
> I am not sure why this error is being thrown/what can be done to fix it.
> These two errors, and mainly the latter one, are rendering the Server/Client un-usable.
Is this a known issue? And how do you recommend working around it?

This message was sent by Atlassian JIRA

View raw message