Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to parse service descriptor #156

Open
xyzhu1120 opened this issue Nov 5, 2020 · 0 comments
Open

Unable to parse service descriptor #156

xyzhu1120 opened this issue Nov 5, 2020 · 0 comments

Comments

@xyzhu1120
Copy link

pyrobuf version: 0.9.3

when parsing the following proto:

message Req { 
  	string user_id = 1;
}

message Rsp { 
    int32 ret_code = 1;
}

service face_recognition { 
      rpc FaceReg (Req) returns (Rsp); 
}

pyrobuf will raise an exception:

Traceback (most recent call last):
  File "/Users/xyz/WorkSpace/python/face_recognition/venv/bin/pyrobuf", line 11, in <module>
    load_entry_point('pyrobuf==0.9.3', 'console_scripts', 'pyrobuf')()
  File "/Users/xyz/WorkSpace/python/face_recognition/venv/lib/python3.7/site-packages/pyrobuf/__main__.py", line 6, in main
    compiler.compile()
  File "/Users/xyz/WorkSpace/python/face_recognition/venv/lib/python3.7/site-packages/pyrobuf/compile.py", line 88, in compile
    self._compile_spec()
  File "/Users/xyz/WorkSpace/python/face_recognition/venv/lib/python3.7/site-packages/pyrobuf/compile.py", line 121, in _compile_spec
    self._generate(source)
  File "/Users/xyz/WorkSpace/python/face_recognition/venv/lib/python3.7/site-packages/pyrobuf/compile.py", line 133, in _generate
    msg_def = self.parser.parse_from_filename(filename, self.includes)
  File "/Users/xyz/WorkSpace/python/face_recognition/venv/lib/python3.7/site-packages/pyrobuf/parse_proto.py", line 264, in parse_from_filename
    raise e
  File "/Users/xyz/WorkSpace/python/face_recognition/venv/lib/python3.7/site-packages/pyrobuf/parse_proto.py", line 261, in parse_from_filename
    return cls(s).parse(fname=fname, includes=includes, disabled_tokens=disabled_tokens)
  File "/Users/xyz/WorkSpace/python/face_recognition/venv/lib/python3.7/site-packages/pyrobuf/parse_proto.py", line 246, in parse
    token.type, token.line + 1, self.lines[token.line]))
Exception: unexpected None token on line 81: 'service face_recognition { '

Any plan to implement this keyword or ignore this keyword instead of raising an exception

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant