Re: [Twisted-Python] self.channel.writeHeaders(version, code, reason, headers)\nbuiltins.AttributeError: \'NoneType\' object has no attribute \'writeHeaders\'\

2019-08-05 Thread Waqar Khan
To add on this.. Glpyh's suggestion was to not call `request.close()` if notifyFinish() deferred has been fired. But I am not sure how do I check if that deffered is available or not. On Mon, Aug 5, 2019 at 2:26 PM Waqar Khan wrote: > Hi Jean, > Yeah, actually that is the example that I looked

Re: [Twisted-Python] self.channel.writeHeaders(version, code, reason, headers)\nbuiltins.AttributeError: \'NoneType\' object has no attribute \'writeHeaders\'\

2019-08-05 Thread Waqar Khan
Hi Jean, Yeah, actually that is the example that I looked into and implemented my code. The issue I have is.. still some instances of interrupted responses are not trapped. Copying pasting my minimal implementation for your convinence def print_json_response(resp, request): request.wri

Re: [Twisted-Python] self.channel.writeHeaders(version, code, reason, headers)\nbuiltins.AttributeError: \'NoneType\' object has no attribute \'writeHeaders\'\

2019-08-05 Thread Jean-Paul Calderone
On Mon, Aug 5, 2019 at 2:15 PM Waqar Khan wrote: > False alarm. Seems like there are some sneaky conditions when I get the > error message. > Like before, I use to get notifyFinish error everytime. Now, it seems that > 6/10 times things are "clean" but then 4/10 times there are notifyFinish > er

Re: [Twisted-Python] self.channel.writeHeaders(version, code, reason, headers)\nbuiltins.AttributeError: \'NoneType\' object has no attribute \'writeHeaders\'\

2019-08-05 Thread Waqar Khan
False alarm. Seems like there are some sneaky conditions when I get the error message. Like before, I use to get notifyFinish error everytime. Now, it seems that 6/10 times things are "clean" but then 4/10 times there are notifyFinish errors. Wondering on your suggestion. How do I ensure whether t