-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Description
I was running the following file:
/python-docs-samples/speech/grpc/transcribe_streaming.py
as following:
python transcribe_streaming.py
It works fine (I get transcript of my speech) until I press Ctrl+C. When I press Ctrl+C I get the following error:
^CTraceback (most recent call last):
File "transcribe_streaming.py", line 234, in
main()
File "transcribe_streaming.py", line 225, in main
listen_print_loop(recognize_stream)
File "transcribe_streaming.py", line 172, in listen_print_loop
for resp in recognize_stream:
File "/usr/local/lib/python2.7/dist-packages/grpc/_channel.py", line 344, in next
return self._next()
File "/usr/local/lib/python2.7/dist-packages/grpc/_channel.py", line 335, in _next
raise self
grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with (StatusCode.CANCELLED, Cancelled!)>
I believe that this error shouldn't be happening because of (in the main() try section):
except face.CancellationError:
# This happens because of the interrupt handler
pass
So my question is what is the right way to stop transcribing? If I just do recognize_stream.cancel() I get these _Rendezvous StatusCode.CANCELLED errors even though there is except face.CancellationError exception handler. Is this a bug or I'm doing something wrong?