You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Manasi Vartak (JIRA)" <ji...@apache.org> on 2017/02/14 13:46:41 UTC
[jira] [Updated] (THRIFT-4089) Several issues with generated Python
code: TFrozenDict, _fast_encode
[ https://issues.apache.org/jira/browse/THRIFT-4089?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Manasi Vartak updated THRIFT-4089:
----------------------------------
Environment: Python 2.7, 3.5. OS-X (was: Python 2.7. OS-X)
> Several issues with generated Python code: TFrozenDict, _fast_encode
> --------------------------------------------------------------------
>
> Key: THRIFT-4089
> URL: https://issues.apache.org/jira/browse/THRIFT-4089
> Project: Thrift
> Issue Type: Bug
> Affects Versions: 0.10.0
> Environment: Python 2.7, 3.5. OS-X
> Reporter: Manasi Vartak
>
> When you generate Python sources for a simple thrift file (e.g. Thrift tutorial from https://thrift.apache.org/tutorial/py 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/SharedService.py", 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 "PythonClient.py", line 51, in main
> client.ping()
> File "gen-py/tutorial/Calculator.py", line 73, in ping
> self.send_ping()
> File "gen-py/tutorial/Calculator.py", line 79, in send_ping
> args.write(self._oprot)
> File "gen-py/tutorial/Calculator.py", 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
(v6.3.15#6346)