[Twisted-web] Web2 and Half-Baked Reinvention of Wheels

Ed Suominen general at eepatents.com
Mon Jul 2 18:21:13 EDT 2007

I have been debugging an odd problem that apparently is arising in
web2.stream.FileStream. One thing I noticed while poring over the source
is that its read() method will try to instantiate SendfileBuffer if you
try to use its sendfile option. However, there's no reference To such a
class anywhere in the module or anywhere else in the Twisted source
tree, for that matter. I understand that sendfile isn't supported, but
it's horrible coding practice to let that just sit there in the source.

As requested by Dialtone, and to borrow liberally from what he wrote in
an IRC chat with me today, web2.stream code is pretty badly tested and
someone should do something about it. (I would also add that it is
pretty badly documented, but that problem is widespread in Twisted's
source, despite my ranting about it for years and offering bounties for
people to contribute docstrings.)

Dialtone says that there are numerous other problems about streams. He
says, and I wholeheartedly agree, that they are mostly a substitution
for something that already exists in twisted, namely Producer/Consumer.
(Please guys, stop chasing butterflies and direct your considerable
talents toward improving what already works!) Dialtone says that glyph
once wrote a replacement for the CompundStream using Producer/Consumer
paradigm; instead of streams, we could use functions that combine
different producers or consumers.

I can't believe that the world's greatest networking platform *still*
doesn't have an adequately supported HTTP server!

Best regards, Ed

More information about the Twisted-web mailing list