[twill] Twill and Django incompatibility?
kumar.mcmillan at gmail.com
Tue Dec 4 12:37:28 PST 2007
On Dec 4, 2007 3:31 AM, Titus Brown <titus at caltech.edu> wrote:
> Antti -- fixed in twill-latest. I was double-calling the iterator in
> certain situations.
> thank you!
> Kumar, this is a bug in wsgi_intercept: code should look like this:
> < for data in self.result:
> > while 1:
> > data = self.result.next()
Ack, ok, thanks. I just finished replying to the django list about this.
It kinda looks like the new version might have the result.next() code
in it. Antti, can you try installing the wsgi_intercept standalone
module to see if the error still happens?
easy_install wsgi_intercept should do it, but then I think you'll need
to obfuscate your local twill copy somehow (or move it aside
temporarily). In case you find that certain methods or modules don't
exist, take a look at the usage examples:
> On Tue, Dec 04, 2007 at 12:34:47AM +0200, Antti Kaihola wrote:
> -> I tried old versions of twill, and it seemed to work correctly in 0.8.4,
> -> but version 0.8.5 introduced this duplicating behavior. I can see that
> -> the application result reading mechanism was heavily modified at that point.
> -> Here are relevant snippets of the source for your convenience.
> -> twill 0.8.4: wsgi_intercept.wsgi_fake_socket.makefile()
> -> http://dpaste.com/hold/26661/
> -> twill 0.8.5: wsgi_intercept.wsgi_fake_socket.makefile()
> -> http://dpaste.com/hold/26662/
> -> diff between the two:
> -> http://dpaste.com/hold/26663/
> -> Antti Kaihola wrote a moment ago:
> -> >Hi,
> -> >
> -> >
> -> >I'm desperately trying to get twill to work together with Django using
> -> >twill's WSGI intercepting.
> -> >
> -> >The problem is, I always get the content of the page concatenated
> -> >twice together. I've debugged and narrowed down the problem so it must
> -> >be either in twill.wsgi_intercept.wsgi_fake_socket.makefile() or
> -> >django.core.handlers.wsgi.WSGIHandler.__call__(). I just don't
> -> >understand WSGI well enough to tell which one is misbehaving.
More information about the twill