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

Waqar Khan wk80333 at gmail.com
Fri Aug 2 17:31:22 MDT 2019


Hi,
  I have a twisted server. And I have been seeing this annoying issue.
Normally. when i develop and test it out. everything is fine..
But then I try to loadtest is via https://locust.io/

Again, everything is fine.. until I "stop" the test.
Then, I see this
'Traceback (most recent call last):\n  File
"/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/events.py",
line 88, in _run\n    self._context.run(self._callback, *self._args)\n
 File "/usr/local/lib/python3.7/site-packages/twisted/internet/defer.py",
line 827, in adapt\n    adapt.actual.callback(extracted)\n  File
"/usr/local/lib/python3.7/site-packages/twisted/internet/defer.py", line
460, in callback\n    self._startRunCallbacks(result)\n  File
"/usr/local/lib/python3.7/site-packages/twisted/internet/defer.py", line
568, in _startRunCallbacks\n    self._runCallbacks()\n--- <exception caught
here> ---\n  File
"/usr/local/lib/python3.7/site-packages/twisted/internet/defer.py", line
654, in _runCallbacks\n    current.result = callback(current.result, *args,
**kw)\n  File
....
 File "/usr/local/lib/python3.7/site-packages/twisted/web/server.py", line
238, in write\n    http.Request.write(self, data)\n  File
"/usr/local/lib/python3.7/site-packages/twisted/web/http.py", line 1118, in
write\n    self.channel.writeHeaders(version, code, reason,
headers)\nbuiltins.AttributeError: \'NoneType\' object has no attribute
\'writeHeaders\'\n'


I found this similar bug report:
https://github.com/buildbot/buildbot/issues/4045
But I am using 19.2.1 twisted version..
Again, this is only triggered when I "stop" the locust io test.
Any suggestions?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20190802/cbca2274/attachment.html>


More information about the Twisted-Python mailing list