2

I've been trying to learn to use Apache Thrift in python by following this tutorial: http://www.billdimmick.com/devjournal/building-an-apache-thrift-service-in-python.html. The thrift file used for this tutorial is:

namespace py demo

service MathService {
    i64 add(1: i64 a, 2: i64 y)
}

When I try to compile this to python code with thrift --gen py:new_style demo.thrift I get the following error:

[ERROR:/home/pi/programming/python/thrift-tutorial/demo.thrift:4] (last token was '{') syntax error
[FAILURE:/home/pi/programming/python/thrift-tutorial/demo.thrift:4] Parser error during include pass

I can't see anything wrong with the thrift file but I'm still getting errors. What's wrong?

  • Works fine for me with thrift 0.9.0. What is the output of `thrift --version`? Can you upload the file somewhere? It may have strange invisible characters or so. – phihag Jul 07 '13 at 20:24
  • I try in java, File tutorial.thrift & shared.thrift on web page seems have an error, in distribution tar.gz is OK. – Jacek Cz Aug 17 '15 at 02:12

0 Answers0