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

Waqar Khan wk80333 at gmail.com
Sun Aug 4 22:04:27 MDT 2019


Ah yes.. That is true..

If I comment out request.finish() (Here is the doc which I tried to
followed:
https://twistedmatrix.com/documents/13.0.0/web/howto/web-in-60/interrupted.html
)
Then actually.. when I try to test out the code... (via curl or like doing
requests.get .. to the URI)..
it is just stuck..

In [491]: requests.get("http://0.0.0.0:9999/test ....with params " )
It just stays stuck :(


I do want to convey my thanks for the help. Really appreciate it.


On Sun, Aug 4, 2019 at 11:55 PM Glyph <glyph at twistedmatrix.com> wrote:

>
>
> > On Aug 4, 2019, at 8:43 PM, Waqar Khan <wk80333 at gmail.com> wrote:
> >
> > Just for sake of completeness:
> > def print_json_response(resp, request):
> >          request.write(json.dumps(resp))
> >          request.close()
>
> Presumably this line actually says "request.finish()"?
>
> This is indeed the problem; just don't call "request.finish()" if
> notifyFinish() has already been callback'd.
>
> -g
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20190805/9f86e7c6/attachment-0002.html>


More information about the Twisted-Python mailing list