title: python How to handle grpc stream after stream cancel() is called
body: <p>I'm trying to write a python client to terminate a gRPC stream</p>
  
  <p>Proto:</p>
  
  <pre><code>rpc Start (StartParameters) returns (stream Progress) {}
  </code></pre>
  
  <p>In the client when I'm ready to terminate the stream, I tried calling stream.cancel() and then when I print the events of the captured stream, it doesn't print the events. I see the exception</p>
  
  <pre><code>&lt;_Rendezvous of RPC that terminated with:
      status = StatusCode.CANCELLED
      details = "Locally cancelled by application!"
      debug_error_string = "None"
  </code></pre>
  
  <p>client.py</p>
  
  <pre><code>stream = self.stub.Start(params)
  time.sleep(120)
  stream.cancel()
  
  for event in stream:
      print(event)
  </code></pre>
  
  <p>Can somebody please help me with a python code to cancel this stream and print the events in the stream.</p>